3 from Data.Maybe import :: Maybe
4 from StdOverloaded import class toString
6 :: Pos = {line :: Int, col :: Int}
7 :: AST = AST [VarDecl] [FunDecl]
8 :: VarDecl = VarDecl Pos Type String Expr
10 = TupleType (Type, Type)
18 | (->>) infixl 7 Type Type
21 | Op2Expr Pos Expr Op2 Expr
22 | Op1Expr Pos Op1 Expr
28 | TupleExpr Pos (Expr, Expr)
29 :: VarDef = VarDef String [FieldSelector]
30 :: FieldSelector = FieldHd | FieldTl | FieldFst | FieldSnd
31 :: Op1 = UnNegation | UnMinus
32 :: Op2 = BiPlus | BiMinus | BiTimes | BiDivide | BiMod | BiEquals | BiLesser |
33 BiGreater | BiLesserEq | BiGreaterEq | BiUnEqual | BiAnd | BiOr | BiCons
34 :: FunDecl = FunDecl Pos String [String] (Maybe Type) [VarDecl] [Stmt]
35 :: FunCall = FunCall String [Expr]
37 = IfStmt Expr [Stmt] [Stmt]
38 | WhileStmt Expr [Stmt]
41 | ReturnStmt (Maybe Expr)
44 instance toString Type