type-level-0.2.4: Type-level programming library

Portability | non-portable (non-standard instances)
Stability | experimental
Maintainer | alfonso.acosta@gmail.com
Safe Haskell | None

Data.TypeLevel.Num.Sets

Description

Type-level numerical sets. Currently there is only support for Naturals and Positives.

Synopsis

- class PosI n => Pos n
- class NatI n => Nat n
- toNum :: (NatI n, Num a) => n -> a
- toInt :: Nat n => n -> Int
- reifyIntegral :: Integral i => i -> (forall n. Nat n => n -> r) -> r

# Documentation

class PosI n => Pos n

Positives (Naturals without zero)

Instances

PosI n => Pos n |

class NatI n => Nat n

Naturals (Positives and zero)

Instances

NatI n => Nat n |

toNum :: (NatI n, Num a) => n -> a

Reflecting function

toInt :: Nat n => n -> Int

Less generic reflecting function (Int)

reifyIntegral :: Integral i => i -> (forall n. Nat n => n -> r) -> r

Reification function. In CPS style (best possible solution)