type-0.1.0: Dynamic casting library with support for arbitrary rank type kinds.Source codeContentsIndex
Data.Type.Kind
Description
Algorithms and operations on type kinds.
Synopsis
data Kind
= KindUnit
| KindArrow Kind Kind
succKind :: Kind -> Kind
recurseKind :: Kind -> Kind
parameters :: Kind -> [Kind]
kindVariables :: String -> Kind -> String
kindSignature :: Kind -> String
kindName :: Kind -> String
readKindName :: String -> Kind
generateKinds :: Int -> [Kind]
Documentation
data Kind Source
Type kind representation.
Constructors
KindUnit
KindArrow Kind Kind
show/hide Instances
succKind :: Kind -> KindSource

Adds -> * to the end of a kind.

             * ==> * -> *
        * -> * ==> * -> * -> *
 (* -> *) -> * ==> (* -> *) -> * -> *
recurseKind :: Kind -> KindSource

Transforms from k to k -> * .

             * ==> * -> *
        * -> * ==> (* -> *) -> *
 (* -> *) -> * ==> ((* -> *) -> *) -> *
parameters :: Kind -> [Kind]Source
Extract kinds of a kinds parameters.
kindVariablesSource
:: StringThe base string to add in front of a position number.
-> KindThe kind being shown.
-> String
Show kinds parameters with kind signatures.
kindSignature :: Kind -> StringSource
Get a kind signature from a Kind.
kindName :: Kind -> StringSource
Get the bastard string representation of a Kind.
readKindName :: String -> KindSource
Read the bastard string representation to Kind.
generateKindsSource
:: Intthe maximum KindUnits allowed.
-> [Kind]

Generates all possible Kinds given the maximum KindUnits allowed.

 1:1 1
 *
 
 2:1 2
 *->*
 
 3:2 4
 *->*->*
 (*->*)->*
 
 4:5 9
 *->*->*->*
 (*->*)->*->*
 *->(*->*)->*
 (*->*->*)->*
 ((*->*)->*)->*
 
 5:14 23
 *->*->*->*->*
 (*->*)->(*->*)->*
 (*->*)->*->*->*
 *->(*->*)->*->*
 *->*->(*->*)->*
 (*->*->*)->*->*
 ((*->*)->*)->*->*
 *->(*->*->*)->*
 *->((*->*)->*)->*
 (*->*->*->*)->*
 ((*->*)->*->*)->*
 (*->(*->*)->*)->*
 ((*->*->*)->*)->*
 (((*->*)->*)->*)->*

The series continues: 1,1,2,5,14,42,132,429,1430,4862,...

Produced by Haddock version 2.4.2