purescript-0.7.0.0: PureScript Programming Language Compiler

Safe HaskellNone
LanguageHaskell98

Language.PureScript.TypeChecker.Unify

Description

Functions and instances relating to unification

Synopsis

Documentation

unifyTypes :: Type -> Type -> UnifyT Type Check () Source

Unify two types, updating the current substitution

unifyRows :: Type -> Type -> UnifyT Type Check () Source

Unify two rows, updating the current substitution

Common labels are first identified, and unified. Remaining labels and types are unified with a trailing row unification variable, if appropriate, otherwise leftover labels result in a unification error.

unifiesWith :: Environment -> Type -> Type -> Bool Source

Check that two types unify

replaceVarWithUnknown :: String -> Type -> UnifyT Type Check Type Source

Replace a single type variable with a new unification variable

replaceTypeWildcards :: Type -> UnifyT t Check Type Source

Replace type wildcards with unknowns

varIfUnknown :: Type -> Type Source

Replace outermost unsolved unification variables with named type variables