type-level-0.3.0: Type-level programming library

Copyright(c) 2008 Alfonso Acosta, Oleg Kiselyov, Wolfgang Jeltsch and KTH's SAM group
LicenseBSD-style (see the file LICENSE)
Maintaineralfonso.acosta@gmail.com
Stabilityexperimental
Portabilitynon-portable (non-standard instances)
Safe HaskellNone
LanguageHaskell98

Data.TypeLevel.Num.Sets

Description

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

Synopsis

Documentation

class PosI n => Pos n Source

Positives (Naturals without zero)

Instances

PosI n => Pos n Source 

class NatI n => Nat n Source

Naturals (Positives and zero)

Instances

NatI n => Nat n Source 

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

Reflecting function

toInt :: Nat n => n -> Int Source

Less generic reflecting function (Int)

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

Reification function. In CPS style (best possible solution)