summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPéter Diviánszky <divipp@gmail.com>2016-04-26 11:41:15 +0200
committerPéter Diviánszky <divipp@gmail.com>2016-04-26 11:41:15 +0200
commitbd332a54485cbc47e756cf1169a9fae48fc5dd2a (patch)
tree7dc903288510ad9c1749656f854cda2332308805 /src
parent926cdbd3f6abcb3b475469a448c9aea2033d688f (diff)
eliminate an error call
Diffstat (limited to 'src')
-rw-r--r--src/LambdaCube/Compiler/Utils.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/LambdaCube/Compiler/Utils.hs b/src/LambdaCube/Compiler/Utils.hs
index 7de304a9..71e4081b 100644
--- a/src/LambdaCube/Compiler/Utils.hs
+++ b/src/LambdaCube/Compiler/Utils.hs
@@ -1,5 +1,6 @@
1{-# LANGUAGE NoMonomorphismRestriction #-} 1{-# LANGUAGE NoMonomorphismRestriction #-}
2{-# LANGUAGE ScopedTypeVariables #-} 2{-# LANGUAGE ScopedTypeVariables #-}
3{-# LANGUAGE EmptyCase #-}
3module LambdaCube.Compiler.Utils where 4module LambdaCube.Compiler.Utils where
4 5
5import qualified Data.IntSet as IS 6import qualified Data.IntSet as IS
@@ -12,13 +13,17 @@ iterateN n f e = iterate f e !! n
12unfoldNat z s 0 = z 13unfoldNat z s 0 = z
13unfoldNat z s n | n > 0 = s $ unfoldNat z s (n-1) 14unfoldNat z s n | n > 0 = s $ unfoldNat z s (n-1)
14 15
16----------------------
17
15data Void 18data Void
16 19
17instance Show Void where show = elimVoid 20instance Show Void where show = elimVoid
18instance Eq Void where x == y = elimVoid x 21instance Eq Void where x == y = elimVoid x
19 22
20elimVoid :: Void -> a 23elimVoid :: Void -> a
21elimVoid _ = error "impossible" 24elimVoid v = case v of
25
26----------------------
22 27
23-- supplementary data: data with no semantic relevance 28-- supplementary data: data with no semantic relevance
24newtype SData a = SData a 29newtype SData a = SData a