gibbon-0.3: A compiler for operating on serialized data
Safe HaskellSafe-Inferred
LanguageHaskell2010

Gibbon.L1.Typecheck

Synopsis

The two main typechecker functions

tcProg :: Prog1 -> PassM Prog1 Source #

Typecheck a L1 program

tcExp :: DDefs1 -> Env2 Ty1 -> Exp1 -> TcM Ty1 Exp1 Source #

Typecheck a L1 expression

Helpers

data TCError exp Source #

Constructors

GenericTC String exp 
VarNotFoundTC Var exp 
UnsupportedExpTC exp 

Instances

Instances details
Out exp => Out (TCError exp) Source # 
Instance details

Defined in Gibbon.L1.Typecheck

Methods

docPrec :: Int -> TCError exp -> Doc Source #

doc :: TCError exp -> Doc Source #

docList :: [TCError exp] -> Doc Source #

Generic (TCError exp) Source # 
Instance details

Defined in Gibbon.L1.Typecheck

Associated Types

type Rep (TCError exp) :: Type -> Type Source #

Methods

from :: TCError exp -> Rep (TCError exp) x Source #

to :: Rep (TCError exp) x -> TCError exp Source #

Show exp => Show (TCError exp) Source # 
Instance details

Defined in Gibbon.L1.Typecheck

Methods

showsPrec :: Int -> TCError exp -> ShowS Source #

show :: TCError exp -> String Source #

showList :: [TCError exp] -> ShowS Source #

Eq exp => Eq (TCError exp) Source # 
Instance details

Defined in Gibbon.L1.Typecheck

Methods

(==) :: TCError exp -> TCError exp -> Bool Source #

(/=) :: TCError exp -> TCError exp -> Bool Source #

Ord exp => Ord (TCError exp) Source # 
Instance details

Defined in Gibbon.L1.Typecheck

Methods

compare :: TCError exp -> TCError exp -> Ordering Source #

(<) :: TCError exp -> TCError exp -> Bool Source #

(<=) :: TCError exp -> TCError exp -> Bool Source #

(>) :: TCError exp -> TCError exp -> Bool Source #

(>=) :: TCError exp -> TCError exp -> Bool Source #

max :: TCError exp -> TCError exp -> TCError exp Source #

min :: TCError exp -> TCError exp -> TCError exp Source #

type Rep (TCError exp) Source # 
Instance details

Defined in Gibbon.L1.Typecheck

extendEnv :: Env2 (UrTy l) -> [(Var, UrTy l)] -> Env2 (UrTy l) Source #

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.

ensureEqualTy :: PreExp e () (UrTy ()) -> Ty1 -> Ty1 -> TcM Ty1 (PreExp e () (UrTy ())) Source #

Ensure that two types are equal. Includes an expression for error reporting. ensureEqualTy :: (Eq l, Out l) => PreExp e () (UrTy ()) -> (UrTy l) -> (UrTy l) -> TcM (UrTy l) PreExp e () (UrTy ())

type TcM a exp = Except (TCError exp) a Source #