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

Gibbon.L0.Typecheck

Synopsis

Documentation

newtype TcM a Source #

Constructors

TcM (ExceptT Doc PassM a) 

Instances

Instances details
MonadFail TcM Source # 
Instance details

Defined in Gibbon.L0.Typecheck

Methods

fail :: String -> TcM a Source #

Applicative TcM Source # 
Instance details

Defined in Gibbon.L0.Typecheck

Methods

pure :: a -> TcM a Source #

(<*>) :: TcM (a -> b) -> TcM a -> TcM b Source #

liftA2 :: (a -> b -> c) -> TcM a -> TcM b -> TcM c Source #

(*>) :: TcM a -> TcM b -> TcM b Source #

(<*) :: TcM a -> TcM b -> TcM a Source #

Functor TcM Source # 
Instance details

Defined in Gibbon.L0.Typecheck

Methods

fmap :: (a -> b) -> TcM a -> TcM b Source #

(<$) :: a -> TcM b -> TcM a Source #

Monad TcM Source # 
Instance details

Defined in Gibbon.L0.Typecheck

Methods

(>>=) :: TcM a -> (a -> TcM b) -> TcM b Source #

(>>) :: TcM a -> TcM b -> TcM b Source #

return :: a -> TcM a Source #

MonadError Doc TcM Source # 
Instance details

Defined in Gibbon.L0.Typecheck

Methods

throwError :: Doc -> TcM a Source #

catchError :: TcM a -> (Doc -> TcM a) -> TcM a Source #

MonadState Int TcM Source # 
Instance details

Defined in Gibbon.L0.Typecheck

Methods

get :: TcM Int Source #

put :: Int -> TcM () Source #

state :: (Int -> (a, Int)) -> TcM a Source #

err :: Doc -> TcM a Source #

tcExps :: DDefs0 -> Subst -> Gamma -> Gamma -> [TyVar] -> [(Bool, Exp0)] -> TcM (Subst, [Ty0], [Exp0]) Source #

tcExp :: DDefs0 -> Subst -> Gamma -> Gamma -> [TyVar] -> Bool -> Exp0 -> TcM (Subst, Ty0, Exp0) Source #

tcCases :: DDefs0 -> Subst -> Gamma -> Gamma -> [TyVar] -> DDef0 -> [(DataCon, [(Var, Ty0)], Exp0)] -> Bool -> Exp0 -> TcM (Subst, Ty0, [(DataCon, [(Var, Ty0)], Exp0)]) Source #

instantiate :: TyScheme -> TcM ([Ty0], Ty0) Source #

Instantiate the topmost for-alls of the argument type with meta type variables.

newtype Subst Source #

Constructors

Subst (Map MetaTv Ty0) 

Instances

Instances details
Out Subst Source # 
Instance details

Defined in Gibbon.L0.Typecheck

Semigroup Subst Source # 
Instance details

Defined in Gibbon.L0.Typecheck

Generic Subst Source # 
Instance details

Defined in Gibbon.L0.Typecheck

Associated Types

type Rep Subst :: Type -> Type Source #

Methods

from :: Subst -> Rep Subst x Source #

to :: Rep Subst x -> Subst Source #

Read Subst Source # 
Instance details

Defined in Gibbon.L0.Typecheck

Show Subst Source # 
Instance details

Defined in Gibbon.L0.Typecheck

Eq Subst Source # 
Instance details

Defined in Gibbon.L0.Typecheck

Methods

(==) :: Subst -> Subst -> Bool Source #

(/=) :: Subst -> Subst -> Bool Source #

Ord Subst Source # 
Instance details

Defined in Gibbon.L0.Typecheck

type Rep Subst Source # 
Instance details

Defined in Gibbon.L0.Typecheck

type Rep Subst = D1 ('MetaData "Subst" "Gibbon.L0.Typecheck" "gibbon-0.3-inplace" 'True) (C1 ('MetaCons "Subst" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map MetaTv Ty0))))

combine :: Ty0 -> Ty0 -> Ty0 Source #

Combine substitutions. In case of substitutions with intersecting keys, we will take the narrower type of the two. e.g. combine [($1, $2)] [($1, IntTy)] should be [($1, IntTy)]. Map.union does a left biased union so it will result in [($1, $2)]

zonkTy :: Subst -> Ty0 -> Ty0 Source #

Perform substitutions in the type.

tyVarToMetaTy :: Ty0 -> TcM (Map TyVar Ty0, Ty0) Source #

Replace the specified quantified type variables by given meta type variables.

unifyl :: Exp0 -> [Ty0] -> [Ty0] -> TcM Subst Source #

Orphan instances

FreeVars a => FreeVars (TyEnv a) Source # 
Instance details

Methods

gFreeVars :: TyEnv a -> Set Var Source #