1 implementation module sem
3 import qualified Data.Map as Map
4 from Data.Func import $
6 import Control.Monad.State
10 from parse import :: ParserOutput
11 from yard import :: Error
13 :: Gamma :== 'Map'.Map String Type
14 :: Env a :== State Gamma a
16 sem :: ParserOutput -> SemOutput
18 sem (Right (AST vd fd)) = Right $ AST vd fd
19 // foldM semVarDecl vd
20 // >>= \gamma ->foldM typecheck gamma fd
22 semVarDecl :: VarDecl -> Env VarDecl
23 semVarDecl (Vardecl pos type ident expr) = undef