swarm-0.7.0.0: 2D resource gathering game with programmable robots
LicenseBSD-3-Clause
Safe HaskellNone
LanguageHaskell2010

Swarm.Language.Kindcheck

Description

Kind checking + type name resolution for the Swarm language.

Synopsis

Documentation

data KindError Source #

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.

Instances

Instances details
Show KindError Source # 
Instance details

Defined in Swarm.Language.Kindcheck

Eq KindError Source # 
Instance details

Defined in Swarm.Language.Kindcheck

PrettyPrec KindError Source # 
Instance details

Defined in Swarm.Language.Kindcheck

Methods

prettyPrec :: Int -> KindError -> Doc ann

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.

processType :: forall (sig :: (Type -> Type) -> Type -> Type) m. (Has (Reader TDCtx) sig m, Has (Throw KindError) sig m) => Type -> m Type Source #

Process a type by doing name resolution and kind checking.