X-Git-Url: https://ruin.nu/git/?p=proglang.git;a=blobdiff_plain;f=Typecheck.hs;fp=Typecheck.hs;h=a701b6e85bf92a0e9f0807251e5eecbfa83c7592;hp=bfef73a68a318cc46188649474881eab2760c4d0;hb=8fdc0177fdf518f63819e5b98dd0368fccca6175;hpb=74c984c4c70336e7b7618cd934db819263ceb565 diff --git a/Typecheck.hs b/Typecheck.hs index bfef73a..a701b6e 100644 --- a/Typecheck.hs +++ b/Typecheck.hs @@ -1,4 +1,4 @@ -module Typecheck (typeCheckExp, typeCheckStm, typeCheckVar, typeCheckFunction, addFunction, State(..)) where +module Typecheck (typeCheckExp, typeCheckStm, typeCheckVar, typeCheckFunction, addFunction, emptyState, State(..)) where import Abssyntax @@ -11,6 +11,7 @@ type Function = (Type, [Type]) data State = State {variables::Types,functions::(Map Ident Function),function::Ident} +emptyState = State{variables=[empty], functions=(empty), function=(Ident "")} inList :: Eq a => a -> [a] -> Bool inList _ [] = False