X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=sem.icl;h=23fb04aa5aa1778bf3c6ed436b7898b3736600b6;hb=13a108705dbabbc75711ce9b3b29fe508262919f;hp=fa081d489061f0562d2cad9f0d9ee3cb516ca761;hpb=392b823861ae02cc42454abce8c97e606931c3d6;p=cc1516.git diff --git a/sem.icl b/sem.icl index fa081d4..23fb04a 100644 --- a/sem.icl +++ b/sem.icl @@ -37,13 +37,15 @@ variableStream :: [String] variableStream = map toString [1..] sem :: AST -> SemOutput -sem (AST vd fd) = Right $ (AST vd fd, 'Map'.newMap) +sem (AST fd) = Right (AST fd, 'Map'.newMap) instance toString Scheme where - toString (Forall x t) = concat ["Forall ": map ((+++) "\n") x] +++ toString t + toString (Forall x t) = + concat ["Forall ": map ((+++) "\n") x] +++ toString t instance toString Gamma where - toString mp = concat [concat [k, ": ", toString v, "\n"]\\(k, v)<-'Map'.toList mp] + toString mp = + concat [concat [k, ": ", toString v, "\n"]\\(k, v)<-'Map'.toList mp] instance toString SemError where toString se = "SemError: " @@ -81,7 +83,7 @@ instance infer Expr where infer (IntExpr _ _) = pure IntType infer (CharExpr _ _) = pure CharType infer (BoolExpr _ _) = pure BoolType - infer (FunExpr _ fc) = undef + infer (FunExpr _ _ _ _) = undef infer (EmptyListExpr _) = undef infer (TupleExpr _ (e1, e2)) = infer e1 >>= \et1->infer e2 >>= \et2->pure $ TupleType (et1, et2)