Implementations of various lambda calculus based systems.Source codeContentsIndex
Typed.Type
Stabilityexperimental
Maintainerthanos@sians.org
Contents
Data types
Supplamentary creators and extractors
Description
Types of the typed system.
Synopsis
data Type
= TpUnit
| TpBool
| TpNat
| TpArrow Type Type
| TpCustom String
| TpBap String
| TpWrong
| TpError String
type Typing = (String, Type)
type Context = [Typing]
baptize :: String -> Type
dom :: Type -> Maybe Type
codom :: Type -> Maybe Type
context :: [String] -> Type -> Context
arrowize :: [Type] -> Type
Data types
data Type Source
Definition of types for this calculus.
Constructors
TpUnitUnit type.
TpBoolBoolean type.
TpNatNatural numbers type.
TpArrow Type TypeFunction type.
TpCustom StringCustom-named type.
TpBap StringBaptized type.
TpWrongWrong type, with an explanation of what went wrong.
TpError StringType error.
show/hide Instances
Eq Type
Show Type
type Typing = (String, Type)Source
A typing of a variable name to a type.
type Context = [Typing]Source
A series of typings.
Supplamentary creators and extractors
baptize :: String -> TypeSource
Make up a type name for the given variable.
dom :: Type -> Maybe TypeSource
Return just the domain of an arrow. If the type has been made up, make up another one for its domain.
codom :: Type -> Maybe TypeSource
Return just the codomain of an arrow. If the type has been made up, make upanother one for its domain.
context :: [String] -> Type -> ContextSource
Type many variables at once with a single Type, returning a Context.
arrowize :: [Type] -> TypeSource
Turn a list of types into an arrow by associating to the right. (Something like foldr1 TpArrow types but returns Unit if empty.)
Produced by Haddock version 2.4.2