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