License | BSD-3-Clause |
---|---|
Safe Haskell | None |
Language | Haskell2010 |
Swarm.Language.Kindcheck
Description
Kind checking + type name resolution for the Swarm language.
Synopsis
- data KindError
- processPolytype :: forall (sig :: (Type -> Type) -> Type -> Type) m. (Has (Reader TDCtx) sig m, Has (Throw KindError) sig m) => Polytype -> m TydefInfo
- processType :: forall (sig :: (Type -> Type) -> Type -> Type) m. (Has (Reader TDCtx) sig m, Has (Throw KindError) sig m) => Type -> m Type
Documentation
Kind checking errors that can occur.
Constructors
ArityMismatch TyCon Int [Type] | A type constructor expects n arguments, but was given these arguments instead. |
UndefinedTyCon TyCon Type | An undefined type constructor was encountered in the given type. |
TrivialRecTy Var Type | A trivial recursive type (one that does not use its bound variable) was encountered. |
VacuousRecTy Var Type | A vacuous recursive type (one that expands immediately to itself) was encountered. |
processPolytype :: forall (sig :: (Type -> Type) -> Type -> Type) m. (Has (Reader TDCtx) sig m, Has (Throw KindError) sig m) => Polytype -> m TydefInfo Source #
Process a polytype, by doing name resolution and kind checking,
and returning an appropriate TydefInfo
record to be used in the
case of a type definition.