Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- newtype TcM a = TcM (ExceptT Doc PassM a)
- runTcM :: TcM a -> PassM (Either Doc a)
- err :: Doc -> TcM a
- tcProg :: Prog0 -> PassM Prog0
- tcFun :: DDefs0 -> Gamma -> FunDef0 -> PassM FunDef0
- tcExps :: DDefs0 -> Subst -> Gamma -> Gamma -> [TyVar] -> [(Bool, Exp0)] -> TcM (Subst, [Ty0], [Exp0])
- tcExp :: DDefs0 -> Subst -> Gamma -> Gamma -> [TyVar] -> Bool -> Exp0 -> TcM (Subst, Ty0, Exp0)
- tcCases :: DDefs0 -> Subst -> Gamma -> Gamma -> [TyVar] -> DDef0 -> [(DataCon, [(Var, Ty0)], Exp0)] -> Bool -> Exp0 -> TcM (Subst, Ty0, [(DataCon, [(Var, Ty0)], Exp0)])
- instantiate :: TyScheme -> TcM ([Ty0], Ty0)
- generalize :: Gamma -> Subst -> [TyVar] -> Ty0 -> TcM (Subst, TyScheme)
- instDataConTy :: DDefs0 -> DataCon -> TcM ([Ty0], [Ty0], Ty0)
- type Gamma = TyEnv TyScheme
- newtype Subst = Subst (Map MetaTv Ty0)
- combine :: Ty0 -> Ty0 -> Ty0
- emptySubst :: Subst
- zonkTy :: Subst -> Ty0 -> Ty0
- zonkTyScheme :: Subst -> TyScheme -> TyScheme
- zonkTyEnv :: Subst -> Gamma -> Gamma
- zonkExp :: Subst -> Exp0 -> Exp0
- substTyVarDDef :: DDef0 -> [Ty0] -> TcM DDef0
- substTyVarExp :: Map TyVar Ty0 -> Exp0 -> Exp0
- substTyVarPrim :: Map TyVar Ty0 -> Prim Ty0 -> Prim Ty0
- tyVarToMetaTyl :: [Ty0] -> TcM (Map TyVar Ty0, [Ty0])
- tyVarToMetaTy :: Ty0 -> TcM (Map TyVar Ty0, Ty0)
- unify :: Exp0 -> Ty0 -> Ty0 -> TcM Subst
- unifyl :: Exp0 -> [Ty0] -> [Ty0] -> TcM Subst
- unifyVar :: Exp0 -> MetaTv -> Ty0 -> TcM Subst
- occursCheck :: MetaTv -> Ty0 -> Bool
- ensureEqualTy :: Exp0 -> Ty0 -> Ty0 -> TcM ()
Documentation
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.
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)]
emptySubst :: Subst Source #
tyVarToMetaTy :: Ty0 -> TcM (Map TyVar Ty0, Ty0) Source #
Replace the specified quantified type variables by given meta type variables.