Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- tcProg :: Prog1 -> PassM Prog1
- tcExp :: DDefs1 -> Env2 Ty1 -> Exp1 -> TcM Ty1 Exp1
- data TCError exp
- = GenericTC String exp
- | VarNotFoundTC Var exp
- | UnsupportedExpTC exp
- extendEnv :: Env2 (UrTy l) -> [(Var, UrTy l)] -> Env2 (UrTy l)
- lookupVar :: Env2 (UrTy l) -> Var -> PreExp e () (UrTy ()) -> TcM (UrTy l) (PreExp e () (UrTy ()))
- tcProj :: Out l => PreExp e () (UrTy ()) -> Int -> UrTy l -> TcM (UrTy l) (PreExp e () (UrTy ()))
- checkLen :: (Out op, Out arg) => PreExp e () (UrTy ()) -> op -> Int -> [arg] -> TcM () (PreExp e () (UrTy ()))
- ensureEqual :: Eq l => PreExp e () (UrTy ()) -> String -> UrTy l -> UrTy l -> TcM (UrTy l) (PreExp e () (UrTy ()))
- ensureEqualTy :: PreExp e () (UrTy ()) -> Ty1 -> Ty1 -> TcM Ty1 (PreExp e () (UrTy ()))
- type TcM a exp = Except (TCError exp) a
The two main typechecker functions
Helpers
GenericTC String exp | |
VarNotFoundTC Var exp | |
UnsupportedExpTC exp |
Instances
lookupVar :: Env2 (UrTy l) -> Var -> PreExp e () (UrTy ()) -> TcM (UrTy l) (PreExp e () (UrTy ())) Source #
tcProj :: Out l => PreExp e () (UrTy ()) -> Int -> UrTy l -> TcM (UrTy l) (PreExp e () (UrTy ())) Source #
checkLen :: (Out op, Out arg) => PreExp e () (UrTy ()) -> op -> Int -> [arg] -> TcM () (PreExp e () (UrTy ())) Source #
ensureEqual :: Eq l => PreExp e () (UrTy ()) -> String -> UrTy l -> UrTy l -> TcM (UrTy l) (PreExp e () (UrTy ())) Source #
Ensure that two things are equal. Includes an expression for error reporting.