type-0.2.0: Dynamic casting library with support for arbitrary rank type kinds.

Data.Type.Kind

Description

Algorithms and operations on type kinds.

Synopsis

Documentation

data Kind

Constructors

StarK 
ArrowK Kind Kind 

kindStars :: Kind -> IntSource

Counts the number of StarKs in a Kind.

succKind :: Kind -> KindSource

Adds -> * to the end of a Kind.

             * ==> * -> *
        * -> * ==> * -> * -> *
 (* -> *) -> * ==> (* -> *) -> * -> *

recurseKind :: Kind -> KindSource

Transforms from k to k -> * .

             * ==> * -> *
        * -> * ==> (* -> *) -> *
 (* -> *) -> * ==> ((* -> *) -> *) -> *

toParameters :: Kind -> [Kind]Source

Extract the parameters of a Kind. Reverse of fromParameters.

fromParameters :: [Kind] -> KindSource

Combine parameter to form a type constructors Kind. Reverse of toParameters.

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

Arguments

:: Int

the maximum StarKs allowed.

-> [Kind] 

Generates all possible Kinds given the maximum StarKs 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,...