strictness, ci
[minfp.git] / ast.dcl
1 definition module ast
2
3 from Data.Either import :: Either
4 from StdOverloaded import class toString
5
6 from int import :: Eval
7
8 :: Function = Function [Char] [[Char]] Expression
9 :: TypeDef = TypeDef [Char] [[Char]] [([Char], [Type])]
10
11 :: Expression
12 = Lit Value
13 | Var [Char]
14 | App Expression Expression
15 | Lambda [Char] Expression
16 | Let [([Char], Expression)] Expression
17
18 :: Value
19 = Int Int
20 | Bool Bool
21 | ** infix 9 Expression Expression
22 | Lambda` [Char] Expression
23 | Builtin (Expression -> Eval Expression)
24
25 :: Type
26 = TVar [Char]
27 | TInt
28 | TBool
29 | TApp Type Type
30 | (-->) infixr 9 Type Type
31
32 instance toString Function, Expression, Value, Type, TypeDef