typerbole-0.0.0.5: A typeystems library with exaggerated claims

Safe HaskellNone
LanguageHaskell2010

Calculi.Lambda.Cube.HigherOrder

Synopsis

Documentation

class SimpleType t => HigherOrder t where Source #

Typeclass for higher-order types. Classically this would just be checking the arity of type constructors but there are more complex typesystems that exist that could benefit from allowing an arbitrary typechecking ability for a higher-order typesystem.

Minimal complete definition

kindcheck, typeap, untypeap

Associated Types

type Kindsystem t :: * Source #

The typesystem for the kindedness of type expressions.

type KindContext t :: * Source #

A typing context for the kindedness of type expressions. Analogue to TypingContext.

type KindError t :: * Source #

Type errors for the kindedness of type expressions. Analogue to TypeError.

Methods

kindcheck :: KindContext t -> t -> Either [KindError t] (KindContext t, Kindsystem t) Source #

Typecheck a type expression.

typeap :: t -> t -> t Source #

More generalised form of abstract to work on all type operators, not just function types.

typeap M (∀a. a) = (∀ a. M a)
typeap T X       = (T X)
typeap (typeap ((→)) A) B ≡ abstract A B

untypeap :: t -> Maybe (t, t) Source #

More generalised form of reify, working on all type application.

untypeap (M x)   = Just (M, x)
untypeap (X → Y) = Just (((→) X), Y)
untypeap X       = Nothing

Instances

(/$) :: HigherOrder t => t -> t -> t infixl 8 Source #

Infix typeap.