Safe Haskell | None |
---|---|
Language | Haskell98 |
Functions relating to skolemization used during typechecking
- newSkolemConstant :: MonadState CheckState m => m Int
- introduceSkolemScope :: MonadState CheckState m => Type -> m Type
- newSkolemScope :: MonadState CheckState m => m SkolemScope
- skolemize :: Text -> Int -> SkolemScope -> Maybe SourceSpan -> Type -> Type
- skolemizeTypesInValue :: Text -> Int -> SkolemScope -> Maybe SourceSpan -> Expr -> Expr
- skolemEscapeCheck :: MonadError MultipleErrors m => Expr -> m ()
Documentation
newSkolemConstant :: MonadState CheckState m => m Int Source #
Generate a new skolem constant
introduceSkolemScope :: MonadState CheckState m => Type -> m Type Source #
Introduce skolem scope at every occurence of a ForAll
newSkolemScope :: MonadState CheckState m => m SkolemScope Source #
Generate a new skolem scope
skolemize :: Text -> Int -> SkolemScope -> Maybe SourceSpan -> Type -> Type Source #
Skolemize a type variable by replacing its instances with fresh skolem constants
skolemizeTypesInValue :: Text -> Int -> SkolemScope -> Maybe SourceSpan -> Expr -> Expr Source #
This function has one purpose - to skolemize type variables appearing in a DeferredDictionary placeholder. These type variables are somewhat unique since they are the only example of scoped type variables.
skolemEscapeCheck :: MonadError MultipleErrors m => Expr -> m () Source #
Ensure skolem variables do not escape their scope