@@ -2,9 +2,11 @@ module IRTS.Lang where
22
33import Core.TT
44import Control.Monad.State hiding(lift)
5+import Data.List
6+import Debug.Trace
57
68data LVar = Loc Int | Glob Name
7− deriving Show
9+ deriving (Show, Eq)
810
911data LExp = LV LVar
1012 | LApp Bool LExp [LExp] -- True = tail call
@@ -19,7 +21,7 @@ data LExp = LV LVar
1921 | LForeign FLang FType String [(FType, LExp)]
2022 | LOp PrimFn [LExp]
2123 | LError String
22− deriving Show
24+ deriving (Show, Eq)
2325
2426data PrimFn = LPlus | LMinus | LTimes | LDiv | LEq | LLt | LLe | LGt | LGe
2527 | LFPlus | LFMinus | LFTimes | LFDiv | LFEq | LFLt | LFLe | LFGt | LFGe
@@ -35,24 +37,24 @@ data PrimFn = LPlus | LMinus | LTimes | LDiv | LEq | LLt | LLe | LGt | LGe
3537 | LStrHead | LStrTail | LStrCons | LStrIndex | LStrRev
3638 | LStdIn | LStdOut | LStdErr
3739 | LNoOp
38− deriving Show
40+ deriving (Show, Eq)
3941
4042-- Supported target languages for foreign calls
4143
4244data FLang = LANG_C
43− deriving Show
45+ deriving (Show, Eq)
4446
4547data FType = FInt | FChar | FString | FUnit | FPtr | FDouble | FAny
46− deriving Show
48+ deriving (Show, Eq)
4749
4850data LAlt = LConCase Int Name [Name] LExp
4951 | LConstCase Const LExp
5052 | LDefaultCase LExp
51− deriving Show
53+ deriving (Show, Eq)
5254
5355data LDecl = LFun Name [Name] LExp -- name, arg names, definition
5456 | LConstructor Name Int Int -- constructor name, tag, arity
55− deriving Show
57+ deriving (Show, Eq)
5658
5759type LDefs = Ctxt LDecl
5860