ltext-0.0.0.1: Higher-order file applicator

Safe HaskellSafe
LanguageHaskell2010

LText.Internal.Inference

Synopsis

Documentation

generalize :: Context -> Type -> Prenex Source

Binds free type variables as universally quantified

data TIState Source

Constructors

TIState 

type TI m a = ExceptT String (StateT TIState m) a Source

Inference Monad

runTI :: (Monad m, MonadError String m) => StateT TIState m a -> m a Source

newTyVar :: (Monad m, MonadState TIState m, MonadError String m) => TypeVar -> m Type Source

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

typeInference :: (Monad m, MonadState TIState m, MonadError String m) => Context -> Expr -> m Type Source

test :: (Monad m, MonadIO m) => Expr -> m () Source