summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Crayne <joe@jerkface.net>2019-04-30 13:44:10 -0400
committerJoe Crayne <joe@jerkface.net>2019-05-14 14:40:21 -0400
commit0399be9fd8a45b5483efa47606bddefdca372a4a (patch)
tree4b540ddb80ef8d106a309738e19b6416a9f995e5
parent873d346e104e4c68ca8be0dc673d936276f3e602 (diff)
Show instances for debugging convenience.
-rw-r--r--src/LambdaCube/Compiler/Core.hs8
-rw-r--r--src/LambdaCube/Compiler/CoreToIR.hs2
-rw-r--r--src/LambdaCube/Compiler/DeBruijn.hs2
-rw-r--r--src/LambdaCube/Compiler/DesugaredSource.hs4
4 files changed, 8 insertions, 8 deletions
diff --git a/src/LambdaCube/Compiler/Core.hs b/src/LambdaCube/Compiler/Core.hs
index a03dce77..83438bb9 100644
--- a/src/LambdaCube/Compiler/Core.hs
+++ b/src/LambdaCube/Compiler/Core.hs
@@ -77,7 +77,7 @@ instance PShow TyCaseFunName where pShow (TyCaseFunName n _) = text $ MatchName
77-------------------------------------------------------------------------------- core expression representation 77-------------------------------------------------------------------------------- core expression representation
78 78
79data Freq = CompileTime | RunTime -- TODO 79data Freq = CompileTime | RunTime -- TODO
80 deriving (Eq, Generic) 80 deriving (Eq, Generic, Show)
81 81
82data Exp 82data Exp
83 = ELit Lit 83 = ELit Lit
@@ -91,7 +91,7 @@ data Exp
91 | Let_ FreeVars ExpType Exp 91 | Let_ FreeVars ExpType Exp
92 | Up_ FreeVars [Int] Exp 92 | Up_ FreeVars [Int] Exp
93 | STOP String 93 | STOP String
94 deriving Generic 94 deriving (Generic, Show)
95 95
96data Neutral 96data Neutral
97 = Var_ !Int{-De Bruijn index-} 97 = Var_ !Int{-De Bruijn index-}
@@ -100,14 +100,14 @@ data Neutral
100 | TyCaseFun__ FreeVars TyCaseFunName [Exp] Neutral 100 | TyCaseFun__ FreeVars TyCaseFunName [Exp] Neutral
101 | Fun_ FreeVars FunName [Exp]{-given parameters, reversed-} Exp{-unfolded expression, in hnf-} 101 | Fun_ FreeVars FunName [Exp]{-given parameters, reversed-} Exp{-unfolded expression, in hnf-}
102 | UpN_ FreeVars [Int] Neutral 102 | UpN_ FreeVars [Int] Neutral
103 deriving Generic 103 deriving (Generic, Show)
104 104
105-------------------------------------------------------------------------------- auxiliary functions and patterns 105-------------------------------------------------------------------------------- auxiliary functions and patterns
106 106
107type Type = Exp 107type Type = Exp
108 108
109data ExpType = ET {expr :: Exp, ty :: Type} 109data ExpType = ET {expr :: Exp, ty :: Type}
110 deriving (Eq, Generic) 110 deriving (Eq, Generic, Show)
111{- 111{-
112pattern ET a b <- ET_ a b 112pattern ET a b <- ET_ a b
113 where ET a b = ET_ a (hnf b) 113 where ET a b = ET_ a (hnf b)
diff --git a/src/LambdaCube/Compiler/CoreToIR.hs b/src/LambdaCube/Compiler/CoreToIR.hs
index b587096e..e0aef2c3 100644
--- a/src/LambdaCube/Compiler/CoreToIR.hs
+++ b/src/LambdaCube/Compiler/CoreToIR.hs
@@ -1024,7 +1024,7 @@ genGLSL backend dns e = case e of
1024 1024
1025-- expression + type + type of local variables 1025-- expression + type + type of local variables
1026data ExpTV = ExpTV_ I.Exp I.Exp [I.Exp] 1026data ExpTV = ExpTV_ I.Exp I.Exp [I.Exp]
1027 deriving (Eq) 1027 deriving (Eq, Show)
1028 1028
1029pattern ExpTV a b c <- ExpTV_ a b c where ExpTV a b c = ExpTV_ (a) (unLab' b) c 1029pattern ExpTV a b c <- ExpTV_ a b c where ExpTV a b c = ExpTV_ (a) (unLab' b) c
1030 1030
diff --git a/src/LambdaCube/Compiler/DeBruijn.hs b/src/LambdaCube/Compiler/DeBruijn.hs
index a3d1d0fd..f929f6b7 100644
--- a/src/LambdaCube/Compiler/DeBruijn.hs
+++ b/src/LambdaCube/Compiler/DeBruijn.hs
@@ -68,7 +68,7 @@ instance Rearrange Void where
68------------------------------------------------------- set of free variables (implemented with bit vectors) 68------------------------------------------------------- set of free variables (implemented with bit vectors)
69 69
70newtype FreeVars = FreeVars Integer 70newtype FreeVars = FreeVars Integer
71 deriving (Eq, Generic) 71 deriving (Eq, Generic, Show)
72 72
73instance Binary FreeVars 73instance Binary FreeVars
74 74
diff --git a/src/LambdaCube/Compiler/DesugaredSource.hs b/src/LambdaCube/Compiler/DesugaredSource.hs
index 510b3de2..dcf1dfbf 100644
--- a/src/LambdaCube/Compiler/DesugaredSource.hs
+++ b/src/LambdaCube/Compiler/DesugaredSource.hs
@@ -319,7 +319,7 @@ data Lit
319 | LChar Char 319 | LChar Char
320 | LFloat Double 320 | LFloat Double
321 | LString String 321 | LString String
322 deriving (Eq, Generic) 322 deriving (Eq, Generic, Show)
323 323
324instance Binary Lit 324instance Binary Lit
325 325
@@ -366,7 +366,7 @@ instance PShow Binder where
366 BMeta -> "BMeta" 366 BMeta -> "BMeta"
367 367
368data Visibility = Hidden | Visible 368data Visibility = Hidden | Visible
369 deriving (Eq, Generic) 369 deriving (Eq, Generic, Show)
370 370
371instance Binary Visibility 371instance Binary Visibility
372 372