tfp-1.0.0.2: Type-level integers, booleans, lists using type families

Safe HaskellSafe
LanguageHaskell2010

Type.Data.Num.Unary

Synopsis

Documentation

data Unary #

Representation name for unary type level numbers.

Instances
Representation Unary # 
Instance details

Defined in Type.Data.Num.Unary

Methods

reifyIntegral :: Proxy Unary -> Integer -> (forall s. (Integer s, Repr s ~ Unary) => Proxy s -> a) -> a #

data Un x #

Instances
Natural n => Integer (Un n) # 
Instance details

Defined in Type.Data.Num.Unary

Associated Types

type Repr (Un n) :: * #

Methods

singleton :: Singleton (Un n) #

type Repr (Un n) # 
Instance details

Defined in Type.Data.Num.Unary

type Repr (Un n) = Unary
type (Un x) :*: (Un y) # 
Instance details

Defined in Type.Data.Num.Unary

type (Un x) :*: (Un y) = Un (x :*: y)
type (Un x) :+: (Un y) # 
Instance details

Defined in Type.Data.Num.Unary

type (Un x) :+: (Un y) = Un (x :+: y)

data Zero #

Instances
Natural Zero # 
Instance details

Defined in Type.Data.Num.Unary

Methods

switchNat :: f Zero -> (forall m. Natural m => f (Succ m)) -> f Zero #

type FromUnary Zero # 
Instance details

Defined in Type.Data.Num.Decimal.Number

type _x :*: Zero # 
Instance details

Defined in Type.Data.Num.Unary

type _x :*: Zero = Zero
type x :+: Zero # 
Instance details

Defined in Type.Data.Num.Unary

type x :+: Zero = x

data Succ x #

Instances
Natural n => Positive (Succ n) # 
Instance details

Defined in Type.Data.Num.Unary

Methods

switchPos :: (forall m. Natural m => f (Succ m)) -> f (Succ n) #

Natural n => Natural (Succ n) # 
Instance details

Defined in Type.Data.Num.Unary

Methods

switchNat :: f Zero -> (forall m. Natural m => f (Succ m)) -> f (Succ n) #

type x :*: (Succ y) # 
Instance details

Defined in Type.Data.Num.Unary

type x :*: (Succ y) = x :+: (x :*: y)
type x :+: (Succ y) # 
Instance details

Defined in Type.Data.Num.Unary

type x :+: (Succ y) = Succ (x :+: y)
type FromUnary (Succ n) # 
Instance details

Defined in Type.Data.Num.Decimal.Number

type FromUnary (Succ n) = Succ (FromUnary n)

succ :: Proxy n -> Proxy (Succ n) #

newtype Singleton n #

Constructors

Singleton Integer 

class Natural n where #

Minimal complete definition

switchNat

Methods

switchNat :: f Zero -> (forall m. Natural m => f (Succ m)) -> f n #

Instances
Natural Zero # 
Instance details

Defined in Type.Data.Num.Unary

Methods

switchNat :: f Zero -> (forall m. Natural m => f (Succ m)) -> f Zero #

Natural n => Natural (Succ n) # 
Instance details

Defined in Type.Data.Num.Unary

Methods

switchNat :: f Zero -> (forall m. Natural m => f (Succ m)) -> f (Succ n) #

class Natural n => Positive n where #

Minimal complete definition

switchPos

Methods

switchPos :: (forall m. Natural m => f (Succ m)) -> f n #

Instances
Natural n => Positive (Succ n) # 
Instance details

Defined in Type.Data.Num.Unary

Methods

switchPos :: (forall m. Natural m => f (Succ m)) -> f (Succ n) #

type family x :+: y #

Instances
type x :+: Zero # 
Instance details

Defined in Type.Data.Num.Unary

type x :+: Zero = x
type x :+: (Succ y) # 
Instance details

Defined in Type.Data.Num.Unary

type x :+: (Succ y) = Succ (x :+: y)

type family x :*: y #

Instances
type _x :*: Zero # 
Instance details

Defined in Type.Data.Num.Unary

type _x :*: Zero = Zero
type x :*: (Succ y) # 
Instance details

Defined in Type.Data.Num.Unary

type x :*: (Succ y) = x :+: (x :*: y)