jl-0.1.0: Functional sed for JSON
Safe HaskellNone
LanguageHaskell2010

JL.Inferer

Description

 
Synopsis

Documentation

infer :: Map Variable Type -> Expression -> [TypeVariable] -> Type Source #

Get the type of the expression.

check :: MonadState [TypeVariable] m => Map Variable Type -> Expression -> m (Type, Set (Type, Type)) Source #

Check the exp with the given context.

generateTypeVariable :: MonadState [TypeVariable] m => m TypeVariable Source #

Generate a fresh type variable.

unify :: Monad m => [(Type, Type)] -> m (Map TypeVariable Type) Source #

Unify the list of constraints.

unifyVariable :: Monad m => TypeVariable -> [(Type, Type)] -> Type -> Type -> m (Map TypeVariable Type) Source #

Unify a type variable for two types.

occurs :: TypeVariable -> Type -> Bool Source #

Occurs check.

substitute :: Map TypeVariable Type -> [(Type, Type)] -> [(Type, Type)] Source #

Substitute the unified type into the constraints.

replace :: Map TypeVariable Type -> Type -> Type Source #

Apply a substitution to a type.

quote :: Text -> Text Source #

Quote something for showing to the programmer.