ddc-core-0.2.1.1: Disciple Core language and type checker.

Safe HaskellSafe-Infered

DDC.Type.Predicates

Description

Predicates on type expressions.

Synopsis

Documentation

isBot :: Type n -> BoolSource

Test if some type is an empty TSum

isAtomT :: Type n -> BoolSource

Check whether a type is a TVar, TCon or is Bottom.

isDataKind :: Kind n -> BoolSource

Check if some kind is the data kind.

isRegionKind :: Region n -> BoolSource

Check if some kind is the region kind.

isEffectKind :: Kind n -> BoolSource

Check if some kind is the effect kind.

isClosureKind :: Kind n -> BoolSource

Check if some kind is the closure kind.

isWitnessKind :: Kind n -> BoolSource

Check if some kind is the witness kind.

isAlgDataType :: Eq n => Type n -> BoolSource

Check whether this type is that of algebraic data.

It needs to have an explicit data constructor out the front, and not a type variable. The constructor must not be the function constructor, and must return a value of kind *.