Kind

ghc-8.0.0.20160204: The GHC API

Safe Haskell | None
Language | Haskell2010

Kind

Contents

- Main data type
  - Predicates on Kinds

Synopsis

- type Kind = Type
- typeKind :: Type -> Kind
- isLiftedTypeKind :: Kind -> Bool
- isUnliftedTypeKind :: Kind -> Bool
- isConstraintKind :: Kind -> Bool
- returnsTyCon :: Unique -> Type -> Bool
- returnsConstraintKind :: Kind -> Bool
- isConstraintKindCon :: TyCon -> Bool
- okArrowArgKind :: Kind -> Bool
- okArrowResultKind :: Kind -> Bool
- classifiesTypeWithValues :: Kind -> Bool
- isStarKind :: Kind -> Bool
- isStarKindSynonymTyCon :: TyCon -> Bool
- isLevityPolymorphic :: Kind -> Bool
- isLevityPolymorphic_maybe :: Kind -> Maybe TyVar

# Main data type

type Kind = Type Source

The key type representing kinds in the compiler.

typeKind :: Type -> Kind Source

## Predicates on Kinds

isLiftedTypeKind :: Kind -> Bool Source

isUnliftedTypeKind :: Kind -> Bool Source

isConstraintKind :: Kind -> Bool Source

returnsTyCon :: Unique -> Type -> Bool Source

Does the given type "end" in the given tycon? For example `k -> [a] -> *` ends in `*` and `Maybe a -> [a]` ends in `[]`.

returnsConstraintKind :: Kind -> Bool Source

isConstraintKindCon :: TyCon -> Bool Source

okArrowArgKind :: Kind -> Bool Source

okArrowResultKind :: Kind -> Bool Source

classifiesTypeWithValues :: Kind -> Bool Source

Does this classify a type allowed to have values? Responds True to things like *, #, TYPE Lifted, TYPE v, Constraint.

True of any sub-kind of OpenTypeKind

isStarKind :: Kind -> Bool Source

Is this kind equivalent to *?

isStarKindSynonymTyCon :: TyCon -> Bool Source

Is the tycon `Constraint`?

isLevityPolymorphic :: Kind -> Bool Source

Tests whether the given type looks like "TYPE v", where v is a variable.

isLevityPolymorphic_maybe :: Kind -> Maybe TyVar Source

Retrieves a levity variable in the given kind, if the kind is of the form "TYPE v".