Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
- newtype Context = Context (Map ExprVar Prenex)
- remove :: Context -> String -> Context
- generalize :: Context -> Type -> Prenex
- data TIState = TIState {}
- runTI :: (Monad m, MonadError String m) => StateT TIState m a -> m a
- newTyVar :: (Monad m, MonadState TIState m, MonadError String m) => TypeVar -> m Type
- instantiate :: (Monad m, MonadState TIState m, MonadError String m) => Prenex -> m Type
- mgu :: (Monad m, MonadState TIState m, MonadError String m) => Type -> Type -> m (Subst TypeVar Type)
- varBind :: (Monad m, MonadState TIState m, MonadError String m) => TypeVar -> Type -> m (Subst TypeVar Type)
- ti :: (Monad m, MonadState TIState m, MonadError String m) => Context -> Expr -> m (Subst TypeVar Type, Type)
- typeInference :: (Monad m, MonadState TIState m, MonadError String m) => Context -> Expr -> m Type
- test :: (Monad m, MonadIO m) => Expr -> m ()
Documentation
generalize :: Context -> Type -> Prenex Source
Binds free type variables as universally quantified
instantiate :: (Monad m, MonadState TIState m, MonadError String m) => Prenex -> m Type Source
Replaces bound type variables with free, fresh ones
mgu :: (Monad m, MonadState TIState m, MonadError String m) => Type -> Type -> m (Subst TypeVar Type) Source
Most general unifier
varBind :: (Monad m, MonadState TIState m, MonadError String m) => TypeVar -> Type -> m (Subst TypeVar Type) Source
Makes a substitution [x -> t]
ti :: (Monad m, MonadState TIState m, MonadError String m) => Context -> Expr -> m (Subst TypeVar Type, Type) Source
Type inference function