type-natural-0.4.0.0: Type-level natural and proofs of their properties.

Safe HaskellNone
LanguageHaskell2010

Data.Type.Natural

Contents

Description

Type level peano natural number, some arithmetic functions and their singletons.

Synopsis

Re-exported modules.

Natural Numbers

Peano natural numbers. It will be promoted to the type-level natural number.

data Nat Source #

Constructors

Z 
S Nat 

Instances

Eq Nat Source # 

Methods

(==) :: Nat -> Nat -> Bool #

(/=) :: Nat -> Nat -> Bool #

Num Nat Source # 

Methods

(+) :: Nat -> Nat -> Nat #

(-) :: Nat -> Nat -> Nat #

(*) :: Nat -> Nat -> Nat #

negate :: Nat -> Nat #

abs :: Nat -> Nat #

signum :: Nat -> Nat #

fromInteger :: Integer -> Nat #

Ord Nat Source # 

Methods

compare :: Nat -> Nat -> Ordering #

(<) :: Nat -> Nat -> Bool #

(<=) :: Nat -> Nat -> Bool #

(>) :: Nat -> Nat -> Bool #

(>=) :: Nat -> Nat -> Bool #

max :: Nat -> Nat -> Nat #

min :: Nat -> Nat -> Nat #

Show Nat Source # 

Methods

showsPrec :: Int -> Nat -> ShowS #

show :: Nat -> String #

showList :: [Nat] -> ShowS #

SingKind Nat Source # 

Associated Types

type DemoteRep Nat :: * #

SNum Nat Source # 
SOrd Nat Source # 

Methods

sCompare :: Sing Nat t0 -> Sing Nat t1 -> Sing Ordering (Apply Nat Ordering (Apply Nat (TyFun Nat Ordering -> Type) (CompareSym0 Nat) t0) t1) #

(%:<) :: Sing Nat t0 -> Sing Nat t1 -> Sing Bool (Apply Nat Bool (Apply Nat (TyFun Nat Bool -> Type) ((:<$) Nat) t0) t1) #

(%:<=) :: Sing Nat t0 -> Sing Nat t1 -> Sing Bool (Apply Nat Bool (Apply Nat (TyFun Nat Bool -> Type) ((:<=$) Nat) t0) t1) #

(%:>) :: Sing Nat t0 -> Sing Nat t1 -> Sing Bool (Apply Nat Bool (Apply Nat (TyFun Nat Bool -> Type) ((:>$) Nat) t0) t1) #

(%:>=) :: Sing Nat t0 -> Sing Nat t1 -> Sing Bool (Apply Nat Bool (Apply Nat (TyFun Nat Bool -> Type) ((:>=$) Nat) t0) t1) #

sMax :: Sing Nat t0 -> Sing Nat t1 -> Sing Nat (Apply Nat Nat (Apply Nat (TyFun Nat Nat -> Type) (MaxSym0 Nat) t0) t1) #

sMin :: Sing Nat t0 -> Sing Nat t1 -> Sing Nat (Apply Nat Nat (Apply Nat (TyFun Nat Nat -> Type) (MinSym0 Nat) t0) t1) #

SEq Nat Source # 

Methods

(%:==) :: Sing Nat a -> Sing Nat b -> Sing Bool ((Nat :== a) b) #

(%:/=) :: Sing Nat a -> Sing Nat b -> Sing Bool ((Nat :/= a) b) #

SDecide Nat Source # 

Methods

(%~) :: Sing Nat a -> Sing Nat b -> Decision ((Nat :~: a) b) #

SingI Nat Z Source # 

Methods

sing :: Sing Z a #

SingI Nat n0 => SingI Nat (S n0) Source # 

Methods

sing :: Sing (S n0) a #

PNum Nat (Proxy * Nat) Source # 

Associated Types

type ((Proxy * Nat) :+ (arg0 :: Proxy * Nat)) (arg1 :: Proxy * Nat) :: a0 #

type ((Proxy * Nat) :- (arg0 :: Proxy * Nat)) (arg1 :: Proxy * Nat) :: a0 #

type ((Proxy * Nat) :* (arg0 :: Proxy * Nat)) (arg1 :: Proxy * Nat) :: a0 #

type Negate (Proxy * Nat) (arg0 :: Proxy * Nat) :: a0 #

type Abs (Proxy * Nat) (arg0 :: Proxy * Nat) :: a0 #

type Signum (Proxy * Nat) (arg0 :: Proxy * Nat) :: a0 #

type FromInteger (Proxy * Nat) (arg0 :: Nat) :: a0 #

POrd Nat (Proxy * Nat) Source # 

Associated Types

type Compare (Proxy * Nat) (arg0 :: Proxy * Nat) (arg1 :: Proxy * Nat) :: Ordering #

type ((Proxy * Nat) :< (arg0 :: Proxy * Nat)) (arg1 :: Proxy * Nat) :: Bool #

type ((Proxy * Nat) :<= (arg0 :: Proxy * Nat)) (arg1 :: Proxy * Nat) :: Bool #

type ((Proxy * Nat) :> (arg0 :: Proxy * Nat)) (arg1 :: Proxy * Nat) :: Bool #

type ((Proxy * Nat) :>= (arg0 :: Proxy * Nat)) (arg1 :: Proxy * Nat) :: Bool #

type Max (Proxy * Nat) (arg0 :: Proxy * Nat) (arg1 :: Proxy * Nat) :: a0 #

type Min (Proxy * Nat) (arg0 :: Proxy * Nat) (arg1 :: Proxy * Nat) :: a0 #

PEq Nat (Proxy * Nat) Source # 

Associated Types

type ((Proxy * Nat) :== (x :: Proxy * Nat)) (y :: Proxy * Nat) :: Bool #

type ((Proxy * Nat) :/= (x :: Proxy * Nat)) (y :: Proxy * Nat) :: Bool #

SuppressUnusedWarnings (Nat -> TyFun Nat Bool -> *) (:<<=$$) Source # 
SuppressUnusedWarnings (TyFun Nat (TyFun Nat Bool -> Type) -> *) (:<<=$) Source # 
SuppressUnusedWarnings (TyFun Nat Nat -> *) SSym0 Source # 
type DemoteRep Nat Source # 
data Sing Nat Source # 
data Sing Nat where
type FromInteger Nat a0 Source # 
type Signum Nat a0 Source # 
type Signum Nat a0
type Abs Nat a0 Source # 
type Abs Nat a0
type Negate Nat arg0 Source # 
type Negate Nat arg0 = Apply Nat Nat (Negate_1627810462Sym0 Nat) arg0
type (:*) Nat a0 a1 Source # 
type (:*) Nat a0 a1
type (:-) Nat a0 a1 Source # 
type (:-) Nat a0 a1
type (:+) Nat a0 a1 Source # 
type (:+) Nat a0 a1
type Min Nat a0 a1 Source # 
type Min Nat a0 a1
type Max Nat a0 a1 Source # 
type Max Nat a0 a1
type (:>=) Nat arg0 arg1 Source # 
type (:>=) Nat arg0 arg1 = Apply Nat Bool (Apply Nat (TyFun Nat Bool -> Type) (TFHelper_1627676309Sym0 Nat) arg0) arg1
type (:>) Nat arg0 arg1 Source # 
type (:>) Nat arg0 arg1 = Apply Nat Bool (Apply Nat (TyFun Nat Bool -> Type) (TFHelper_1627676276Sym0 Nat) arg0) arg1
type (:<=) Nat a0 a1 Source # 
type (:<=) Nat a0 a1
type (:<) Nat arg0 arg1 Source # 
type (:<) Nat arg0 arg1 = Apply Nat Bool (Apply Nat (TyFun Nat Bool -> Type) (TFHelper_1627676210Sym0 Nat) arg0) arg1
type Compare Nat arg0 arg1 Source # 
type Compare Nat arg0 arg1 = Apply Nat Ordering (Apply Nat (TyFun Nat Ordering -> Type) (Compare_1627676177Sym0 Nat) arg0) arg1
type (:/=) Nat x y Source # 
type (:/=) Nat x y = Not ((:==) Nat x y)
type (:==) Nat a0 b0 Source # 
type (:==) Nat a0 b0
type Apply Nat Nat SSym0 l0 Source # 
type Apply Nat Nat SSym0 l0 = SSym1 l0
type Apply Nat Bool ((:<<=$$) l1) l0 Source # 
type Apply Nat Bool ((:<<=$$) l1) l0 = (:<<=$$$) l1 l0
type MonomorphicRep Nat (Sing Nat) # 
type Apply Nat (TyFun Nat Bool -> Type) (:<<=$) l0 Source # 

type SSym1 t = S t Source #

type ZSym0 = Z Source #

Singleton type for Nat.

type SNat = (Sing :: Nat -> Type) Source #

data family Sing k (a :: k) :: * #

The singleton kind-indexed data family.

Instances

data Sing Bool 
data Sing Bool where
data Sing Ordering 
data Sing Nat 
data Sing Nat where
data Sing Symbol 
data Sing Symbol where
data Sing () 
data Sing () where
data Sing Nat # 
data Sing Nat where
type MonomorphicRep Nat (Sing Nat) # 
data Sing [a0] 
data Sing [a0] where
data Sing (Maybe a0) 
data Sing (Maybe a0) where
data Sing (NonEmpty a0) 
data Sing (NonEmpty a0) where
data Sing (Either a0 b0) 
data Sing (Either a0 b0) where
data Sing (a0, b0) 
data Sing (a0, b0) where
data Sing ((~>) k1 k2) 
data Sing ((~>) k1 k2) = SLambda {}
data Sing (a0, b0, c0) 
data Sing (a0, b0, c0) where
data Sing (a0, b0, c0, d0) 
data Sing (a0, b0, c0, d0) where
data Sing (a0, b0, c0, d0, e0) 
data Sing (a0, b0, c0, d0, e0) where
data Sing (a0, b0, c0, d0, e0, f0) 
data Sing (a0, b0, c0, d0, e0, f0) where
data Sing (a0, b0, c0, d0, e0, f0, g0) 
data Sing (a0, b0, c0, d0, e0, f0, g0) where

Arithmetic functions and their singletons.

min :: Ord a => a -> a -> a #

type family Min a0 (arg0 :: a0) (arg1 :: a0) :: a0 #

Instances

type Min Bool arg0 arg1 
type Min Bool arg0 arg1 = Apply Bool Bool (Apply Bool (TyFun Bool Bool -> Type) (Min_1627676375Sym0 Bool) arg0) arg1
type Min Ordering arg0 arg1 
type Min Ordering arg0 arg1 = Apply Ordering Ordering (Apply Ordering (TyFun Ordering Ordering -> Type) (Min_1627676375Sym0 Ordering) arg0) arg1
type Min Nat arg0 arg1 
type Min Nat arg0 arg1 = Apply Nat Nat (Apply Nat (TyFun Nat Nat -> Type) (Min_1627676375Sym0 Nat) arg0) arg1
type Min Symbol arg0 arg1 
type Min Symbol arg0 arg1 = Apply Symbol Symbol (Apply Symbol (TyFun Symbol Symbol -> Type) (Min_1627676375Sym0 Symbol) arg0) arg1
type Min () arg0 arg1 
type Min () arg0 arg1 = Apply () () (Apply () (TyFun () () -> Type) (Min_1627676375Sym0 ()) arg0) arg1
type Min Nat a0 a1 # 
type Min Nat a0 a1
type Min [a0] arg0 arg1 
type Min [a0] arg0 arg1 = Apply [a0] [a0] (Apply [a0] (TyFun [a0] [a0] -> Type) (Min_1627676375Sym0 [a0]) arg0) arg1
type Min (Maybe a0) arg0 arg1 
type Min (Maybe a0) arg0 arg1 = Apply (Maybe a0) (Maybe a0) (Apply (Maybe a0) (TyFun (Maybe a0) (Maybe a0) -> Type) (Min_1627676375Sym0 (Maybe a0)) arg0) arg1
type Min (NonEmpty a0) arg0 arg1 
type Min (NonEmpty a0) arg0 arg1 = Apply (NonEmpty a0) (NonEmpty a0) (Apply (NonEmpty a0) (TyFun (NonEmpty a0) (NonEmpty a0) -> Type) (Min_1627676375Sym0 (NonEmpty a0)) arg0) arg1
type Min (Either a0 b0) arg0 arg1 
type Min (Either a0 b0) arg0 arg1 = Apply (Either a0 b0) (Either a0 b0) (Apply (Either a0 b0) (TyFun (Either a0 b0) (Either a0 b0) -> Type) (Min_1627676375Sym0 (Either a0 b0)) arg0) arg1
type Min (a0, b0) arg0 arg1 
type Min (a0, b0) arg0 arg1 = Apply (a0, b0) (a0, b0) (Apply (a0, b0) (TyFun (a0, b0) (a0, b0) -> Type) (Min_1627676375Sym0 (a0, b0)) arg0) arg1
type Min (a0, b0, c0) arg0 arg1 
type Min (a0, b0, c0) arg0 arg1 = Apply (a0, b0, c0) (a0, b0, c0) (Apply (a0, b0, c0) (TyFun (a0, b0, c0) (a0, b0, c0) -> Type) (Min_1627676375Sym0 (a0, b0, c0)) arg0) arg1
type Min (a0, b0, c0, d0) arg0 arg1 
type Min (a0, b0, c0, d0) arg0 arg1 = Apply (a0, b0, c0, d0) (a0, b0, c0, d0) (Apply (a0, b0, c0, d0) (TyFun (a0, b0, c0, d0) (a0, b0, c0, d0) -> Type) (Min_1627676375Sym0 (a0, b0, c0, d0)) arg0) arg1
type Min (a0, b0, c0, d0, e0) arg0 arg1 
type Min (a0, b0, c0, d0, e0) arg0 arg1 = Apply (a0, b0, c0, d0, e0) (a0, b0, c0, d0, e0) (Apply (a0, b0, c0, d0, e0) (TyFun (a0, b0, c0, d0, e0) (a0, b0, c0, d0, e0) -> Type) (Min_1627676375Sym0 (a0, b0, c0, d0, e0)) arg0) arg1
type Min (a0, b0, c0, d0, e0, f0) arg0 arg1 
type Min (a0, b0, c0, d0, e0, f0) arg0 arg1 = Apply (a0, b0, c0, d0, e0, f0) (a0, b0, c0, d0, e0, f0) (Apply (a0, b0, c0, d0, e0, f0) (TyFun (a0, b0, c0, d0, e0, f0) (a0, b0, c0, d0, e0, f0) -> Type) (Min_1627676375Sym0 (a0, b0, c0, d0, e0, f0)) arg0) arg1
type Min (a0, b0, c0, d0, e0, f0, g0) arg0 arg1 
type Min (a0, b0, c0, d0, e0, f0, g0) arg0 arg1 = Apply (a0, b0, c0, d0, e0, f0, g0) (a0, b0, c0, d0, e0, f0, g0) (Apply (a0, b0, c0, d0, e0, f0, g0) (TyFun (a0, b0, c0, d0, e0, f0, g0) (a0, b0, c0, d0, e0, f0, g0) -> Type) (Min_1627676375Sym0 (a0, b0, c0, d0, e0, f0, g0)) arg0) arg1

sMin :: SOrd a0 => forall t0 t1. Sing a0 t0 -> Sing a0 t1 -> Sing a0 (Apply a0 a0 (Apply a0 (TyFun a0 a0 -> Type) (MinSym0 a0) t0) t1) #

max :: Ord a => a -> a -> a #

type family Max a0 (arg0 :: a0) (arg1 :: a0) :: a0 #

Instances

type Max Bool arg0 arg1 
type Max Bool arg0 arg1 = Apply Bool Bool (Apply Bool (TyFun Bool Bool -> Type) (Max_1627676342Sym0 Bool) arg0) arg1
type Max Ordering arg0 arg1 
type Max Ordering arg0 arg1 = Apply Ordering Ordering (Apply Ordering (TyFun Ordering Ordering -> Type) (Max_1627676342Sym0 Ordering) arg0) arg1
type Max Nat arg0 arg1 
type Max Nat arg0 arg1 = Apply Nat Nat (Apply Nat (TyFun Nat Nat -> Type) (Max_1627676342Sym0 Nat) arg0) arg1
type Max Symbol arg0 arg1 
type Max Symbol arg0 arg1 = Apply Symbol Symbol (Apply Symbol (TyFun Symbol Symbol -> Type) (Max_1627676342Sym0 Symbol) arg0) arg1
type Max () arg0 arg1 
type Max () arg0 arg1 = Apply () () (Apply () (TyFun () () -> Type) (Max_1627676342Sym0 ()) arg0) arg1
type Max Nat a0 a1 # 
type Max Nat a0 a1
type Max [a0] arg0 arg1 
type Max [a0] arg0 arg1 = Apply [a0] [a0] (Apply [a0] (TyFun [a0] [a0] -> Type) (Max_1627676342Sym0 [a0]) arg0) arg1
type Max (Maybe a0) arg0 arg1 
type Max (Maybe a0) arg0 arg1 = Apply (Maybe a0) (Maybe a0) (Apply (Maybe a0) (TyFun (Maybe a0) (Maybe a0) -> Type) (Max_1627676342Sym0 (Maybe a0)) arg0) arg1
type Max (NonEmpty a0) arg0 arg1 
type Max (NonEmpty a0) arg0 arg1 = Apply (NonEmpty a0) (NonEmpty a0) (Apply (NonEmpty a0) (TyFun (NonEmpty a0) (NonEmpty a0) -> Type) (Max_1627676342Sym0 (NonEmpty a0)) arg0) arg1
type Max (Either a0 b0) arg0 arg1 
type Max (Either a0 b0) arg0 arg1 = Apply (Either a0 b0) (Either a0 b0) (Apply (Either a0 b0) (TyFun (Either a0 b0) (Either a0 b0) -> Type) (Max_1627676342Sym0 (Either a0 b0)) arg0) arg1
type Max (a0, b0) arg0 arg1 
type Max (a0, b0) arg0 arg1 = Apply (a0, b0) (a0, b0) (Apply (a0, b0) (TyFun (a0, b0) (a0, b0) -> Type) (Max_1627676342Sym0 (a0, b0)) arg0) arg1
type Max (a0, b0, c0) arg0 arg1 
type Max (a0, b0, c0) arg0 arg1 = Apply (a0, b0, c0) (a0, b0, c0) (Apply (a0, b0, c0) (TyFun (a0, b0, c0) (a0, b0, c0) -> Type) (Max_1627676342Sym0 (a0, b0, c0)) arg0) arg1
type Max (a0, b0, c0, d0) arg0 arg1 
type Max (a0, b0, c0, d0) arg0 arg1 = Apply (a0, b0, c0, d0) (a0, b0, c0, d0) (Apply (a0, b0, c0, d0) (TyFun (a0, b0, c0, d0) (a0, b0, c0, d0) -> Type) (Max_1627676342Sym0 (a0, b0, c0, d0)) arg0) arg1
type Max (a0, b0, c0, d0, e0) arg0 arg1 
type Max (a0, b0, c0, d0, e0) arg0 arg1 = Apply (a0, b0, c0, d0, e0) (a0, b0, c0, d0, e0) (Apply (a0, b0, c0, d0, e0) (TyFun (a0, b0, c0, d0, e0) (a0, b0, c0, d0, e0) -> Type) (Max_1627676342Sym0 (a0, b0, c0, d0, e0)) arg0) arg1
type Max (a0, b0, c0, d0, e0, f0) arg0 arg1 
type Max (a0, b0, c0, d0, e0, f0) arg0 arg1 = Apply (a0, b0, c0, d0, e0, f0) (a0, b0, c0, d0, e0, f0) (Apply (a0, b0, c0, d0, e0, f0) (TyFun (a0, b0, c0, d0, e0, f0) (a0, b0, c0, d0, e0, f0) -> Type) (Max_1627676342Sym0 (a0, b0, c0, d0, e0, f0)) arg0) arg1
type Max (a0, b0, c0, d0, e0, f0, g0) arg0 arg1 
type Max (a0, b0, c0, d0, e0, f0, g0) arg0 arg1 = Apply (a0, b0, c0, d0, e0, f0, g0) (a0, b0, c0, d0, e0, f0, g0) (Apply (a0, b0, c0, d0, e0, f0, g0) (TyFun (a0, b0, c0, d0, e0, f0, g0) (a0, b0, c0, d0, e0, f0, g0) -> Type) (Max_1627676342Sym0 (a0, b0, c0, d0, e0, f0, g0)) arg0) arg1

sMax :: SOrd a0 => forall t0 t1. Sing a0 t0 -> Sing a0 t1 -> Sing a0 (Apply a0 a0 (Apply a0 (TyFun a0 a0 -> Type) (MaxSym0 a0) t0) t1) #

data MinSym0 a1627675388 l0 :: forall a1627675388. TyFun a1627675388 (TyFun a1627675388 a1627675388 -> Type) -> * #

Instances

SuppressUnusedWarnings (TyFun a1627675388 (TyFun a1627675388 a1627675388 -> Type) -> *) (MinSym0 a1627675388) 

Methods

suppressUnusedWarnings :: Proxy (MinSym0 a1627675388) t -> () #

type Apply a1627675388 (TyFun a1627675388 a1627675388 -> Type) (MinSym0 a1627675388) l0 
type Apply a1627675388 (TyFun a1627675388 a1627675388 -> Type) (MinSym0 a1627675388) l0 = MinSym1 a1627675388 l0

data MinSym1 a1627675388 l0 l1 :: forall a1627675388. a1627675388 -> TyFun a1627675388 a1627675388 -> * #

Instances

SuppressUnusedWarnings (a1627675388 -> TyFun a1627675388 a1627675388 -> *) (MinSym1 a1627675388) 

Methods

suppressUnusedWarnings :: Proxy (MinSym1 a1627675388) t -> () #

type Apply a1627675388 a1627675388 (MinSym1 a1627675388 l1) l0 
type Apply a1627675388 a1627675388 (MinSym1 a1627675388 l1) l0 = MinSym2 a1627675388 l1 l0

type MinSym2 a1627675388 t0 t1 = Min a1627675388 t0 t1 #

data MaxSym0 a1627675388 l0 :: forall a1627675388. TyFun a1627675388 (TyFun a1627675388 a1627675388 -> Type) -> * #

Instances

SuppressUnusedWarnings (TyFun a1627675388 (TyFun a1627675388 a1627675388 -> Type) -> *) (MaxSym0 a1627675388) 

Methods

suppressUnusedWarnings :: Proxy (MaxSym0 a1627675388) t -> () #

type Apply a1627675388 (TyFun a1627675388 a1627675388 -> Type) (MaxSym0 a1627675388) l0 
type Apply a1627675388 (TyFun a1627675388 a1627675388 -> Type) (MaxSym0 a1627675388) l0 = MaxSym1 a1627675388 l0

data MaxSym1 a1627675388 l0 l1 :: forall a1627675388. a1627675388 -> TyFun a1627675388 a1627675388 -> * #

Instances

SuppressUnusedWarnings (a1627675388 -> TyFun a1627675388 a1627675388 -> *) (MaxSym1 a1627675388) 

Methods

suppressUnusedWarnings :: Proxy (MaxSym1 a1627675388) t -> () #

type Apply a1627675388 a1627675388 (MaxSym1 a1627675388 l1) l0 
type Apply a1627675388 a1627675388 (MaxSym1 a1627675388 l1) l0 = MaxSym2 a1627675388 l1 l0

type MaxSym2 a1627675388 t0 t1 = Max a1627675388 t0 t1 #

type (:+:) n m = n :+ m infixl 6 Source #

type family (a0 :+ (arg0 :: a0)) (arg1 :: a0) :: a0 #

Instances

type (:+) Nat a b 
type (:+) Nat a b = (+) a b
type (:+) Nat a0 a1 # 
type (:+) Nat a0 a1

data a1627810386 :+$ l0 :: forall a1627810386. TyFun a1627810386 (TyFun a1627810386 a1627810386 -> Type) -> * #

Instances

SuppressUnusedWarnings (TyFun a1627810386 (TyFun a1627810386 a1627810386 -> Type) -> *) ((:+$) a1627810386) 

Methods

suppressUnusedWarnings :: Proxy ((:+$) a1627810386) t -> () #

type Apply a1627810386 (TyFun a1627810386 a1627810386 -> Type) ((:+$) a1627810386) l0 
type Apply a1627810386 (TyFun a1627810386 a1627810386 -> Type) ((:+$) a1627810386) l0 = (:+$$) a1627810386 l0

data (a1627810386 :+$$ l0) l1 :: forall a1627810386. a1627810386 -> TyFun a1627810386 a1627810386 -> * #

Instances

SuppressUnusedWarnings (a1627810386 -> TyFun a1627810386 a1627810386 -> *) ((:+$$) a1627810386) 

Methods

suppressUnusedWarnings :: Proxy ((:+$$) a1627810386) t -> () #

type Apply a1627810386 a1627810386 ((:+$$) a1627810386 l1) l0 
type Apply a1627810386 a1627810386 ((:+$$) a1627810386 l1) l0 = (:+$$$) a1627810386 l1 l0

type (:+$$$) a1627810386 t0 t1 = (:+) a1627810386 t0 t1 #

(%+) :: SNat n -> SNat m -> SNat (n :+: m) infixl 6 Source #

Addition for singleton numbers.

(%:+) :: SNum a0 => forall t0 t1. Sing a0 t0 -> Sing a0 t1 -> Sing a0 (Apply a0 a0 (Apply a0 (TyFun a0 a0 -> Type) ((:+$) a0) t0) t1) #

type family (a0 :* (arg0 :: a0)) (arg1 :: a0) :: a0 #

Instances

type (:*) Nat a b 
type (:*) Nat a b = * a b
type (:*) Nat a0 a1 # 
type (:*) Nat a0 a1

type (:*:) n m = n :* m infixl 7 Source #

Type-level multiplication.

data a1627810386 :*$ l0 :: forall a1627810386. TyFun a1627810386 (TyFun a1627810386 a1627810386 -> Type) -> * #

Instances

SuppressUnusedWarnings (TyFun a1627810386 (TyFun a1627810386 a1627810386 -> Type) -> *) ((:*$) a1627810386) 

Methods

suppressUnusedWarnings :: Proxy ((:*$) a1627810386) t -> () #

type Apply a1627810386 (TyFun a1627810386 a1627810386 -> Type) ((:*$) a1627810386) l0 
type Apply a1627810386 (TyFun a1627810386 a1627810386 -> Type) ((:*$) a1627810386) l0 = (:*$$) a1627810386 l0

data (a1627810386 :*$$ l0) l1 :: forall a1627810386. a1627810386 -> TyFun a1627810386 a1627810386 -> * #

Instances

SuppressUnusedWarnings (a1627810386 -> TyFun a1627810386 a1627810386 -> *) ((:*$$) a1627810386) 

Methods

suppressUnusedWarnings :: Proxy ((:*$$) a1627810386) t -> () #

type Apply a1627810386 a1627810386 ((:*$$) a1627810386 l1) l0 
type Apply a1627810386 a1627810386 ((:*$$) a1627810386 l1) l0 = (:*$$$) a1627810386 l1 l0

type (:*$$$) a1627810386 t0 t1 = (:*) a1627810386 t0 t1 #

(%:*) :: SNum a0 => forall t0 t1. Sing a0 t0 -> Sing a0 t1 -> Sing a0 (Apply a0 a0 (Apply a0 (TyFun a0 a0 -> Type) ((:*$) a0) t0) t1) #

(%*) :: SNat n -> SNat m -> SNat (n :*: m) infixl 7 Source #

Multiplication for singleton numbers.

type (:-:) n m = n :- m infixl 6 Source #

type family (a0 :- (arg0 :: a0)) (arg1 :: a0) :: a0 #

Instances

type (:-) Nat a b 
type (:-) Nat a b = (-) a b
type (:-) Nat a0 a1 # 
type (:-) Nat a0 a1

type (:**:) n m = n :** m Source #

Type-level exponentiation.

type family (a :: Nat) :** (a :: Nat) :: Nat where ... Source #

Equations

_z_1627480629 :** Z = Apply SSym0 ZSym0 
n :** (S m) = Apply (Apply (:*$) (Apply (Apply (:**$) n) m)) n 

(%:**) :: forall t t. Sing t -> Sing t -> Sing (Apply (Apply (:**$) t) t :: Nat) Source #

(%**) :: SNat n -> SNat m -> SNat (n :**: m) Source #

Exponentiation for singleton numbers.

data a1627810386 :-$ l0 :: forall a1627810386. TyFun a1627810386 (TyFun a1627810386 a1627810386 -> Type) -> * #

Instances

SuppressUnusedWarnings (TyFun a1627810386 (TyFun a1627810386 a1627810386 -> Type) -> *) ((:-$) a1627810386) 

Methods

suppressUnusedWarnings :: Proxy ((:-$) a1627810386) t -> () #

type Apply a1627810386 (TyFun a1627810386 a1627810386 -> Type) ((:-$) a1627810386) l0 
type Apply a1627810386 (TyFun a1627810386 a1627810386 -> Type) ((:-$) a1627810386) l0 = (:-$$) a1627810386 l0

data (a1627810386 :-$$ l0) l1 :: forall a1627810386. a1627810386 -> TyFun a1627810386 a1627810386 -> * #

Instances

SuppressUnusedWarnings (a1627810386 -> TyFun a1627810386 a1627810386 -> *) ((:-$$) a1627810386) 

Methods

suppressUnusedWarnings :: Proxy ((:-$$) a1627810386) t -> () #

type Apply a1627810386 a1627810386 ((:-$$) a1627810386 l1) l0 
type Apply a1627810386 a1627810386 ((:-$$) a1627810386 l1) l0 = (:-$$$) a1627810386 l1 l0

type (:-$$$) a1627810386 t0 t1 = (:-) a1627810386 t0 t1 #

(%:-) :: SNum a0 => forall t0 t1. Sing a0 t0 -> Sing a0 t1 -> Sing a0 (Apply a0 a0 (Apply a0 (TyFun a0 a0 -> Type) ((:-$) a0) t0) t1) #

(%-) :: (m :<<= n) ~ True => SNat n -> SNat m -> SNat (n :-: m) infixl 6 Source #

Type-level predicate & judgements

data Leq n m where Source #

Comparison via GADTs.

Constructors

ZeroLeq :: SNat m -> Leq Zero m 
SuccLeqSucc :: Leq n m -> Leq (S n) (S m) 

class n :<= m Source #

Comparison via type-class.

Instances

Z :<= n Source # 
(:<=) n m => (S n) :<= (S m) Source # 

type family (a :: Nat) :<<= (a :: Nat) :: Bool where ... Source #

Boolean-valued type-level comparison function.

Equations

Z :<<= _z_1627483216 = TrueSym0 
(S _z_1627483219) :<<= Z = FalseSym0 
(S n) :<<= (S m) = Apply (Apply (:<<=$) n) m 

data l :<<=$$ l Source #

type (:<<=$$$) t t = (:<<=) t t Source #

(%:<<=) :: forall t t. Sing t -> Sing t -> Sing (Apply (Apply (:<<=$) t) t :: Bool) Source #

type LeqInstance n m = Dict (n :<= m) Source #

boolToPropLeq :: (n :<<= m) ~ True => SNat n -> SNat m -> Leq n m Source #

boolToClassLeq :: (n :<<= m) ~ True => SNat n -> SNat m -> LeqInstance n m Source #

type LeqTrueInstance a b = Dict ((a :<<= b) ~ True) Source #

propToBoolLeq :: forall n m. Leq n m -> LeqTrueInstance n m Source #

Conversion functions

natToInt :: Integral n => Nat -> n Source #

Convert Nat into normal integers.

intToNat :: (Integral a, Ord a) => a -> Nat Source #

Convert integral numbers into Nat

sNatToInt :: Num n => SNat x -> n Source #

Convert 'SNat n' into normal integers.

Quasi quotes for natural numbers

nat :: QuasiQuoter Source #

Quotesi-quoter for Nat. This can be used for an expression, pattern and type.

for example: sing :: SNat ([nat| 2 |] :+ [nat| 5 |])

snat :: QuasiQuoter Source #

Quotesi-quoter for SNat. This can be used for an expression, pattern and type.

For example: [snat|12|] %+ [snat| 5 |], sing :: [snat| 12 |], f [snat| 12 |] = "hey"

Properties of natural numbers

succCongEq :: (n :=: m) -> S n :=: S m Source #

plusCongR :: SNat n -> (m :=: m') -> (m :+ n) :=: (m' :+ n) Source #

plusCongL :: SNat n -> (m :=: m') -> (n :+ m) :=: (n :+ m') Source #

succPlusL :: SNat n -> SNat m -> (S n :+ m) :=: S (n :+ m) Source #

succPlusR :: SNat n -> SNat m -> (n :+ S m) :=: S (n :+ m) Source #

pluSZR :: SNat n -> (n :+: Z) :=: n Source #

pluSZL :: SNat n -> (Z :+: n) :=: n Source #

eqPreserveSS :: (n :=: m) -> S n :=: S m Source #

plusAssociative :: SNat n -> SNat m -> SNat l -> (n :+: (m :+: l)) :=: ((n :+: m) :+: l) Source #

multAssociative :: SNat n -> SNat m -> SNat l -> (n :* (m :* l)) :=: ((n :* m) :* l) Source #

multComm :: SNat n -> SNat m -> (n :* m) :=: (m :* n) Source #

multOneL :: SNat n -> (One :* n) :=: n Source #

multOneR :: SNat n -> (n :* One) :=: n Source #

snEqZAbsurd :: (S n :=: Z) -> a Source #

succInjective :: (S n :=: S m) -> n :=: m Source #

plusInjectiveL :: SNat n -> SNat m -> SNat l -> ((n :+ m) :=: (n :+ l)) -> m :=: l Source #

plusInjectiveR :: SNat n -> SNat m -> SNat l -> ((n :+ l) :=: (m :+ l)) -> n :=: m Source #

plusMultDistr :: SNat n -> SNat m -> SNat l -> ((n :+ m) :* l) :=: ((n :* l) :+ (m :* l)) Source #

multPlusDistr :: forall n m l. SNat n -> SNat m -> SNat l -> (n :* (m :+ l)) :=: ((n :* m) :+ (n :* l)) Source #

multCongL :: SNat n -> (m :=: l) -> (n :* m) :=: (n :* l) Source #

multCongR :: SNat n -> (m :=: l) -> (m :* n) :=: (l :* n) Source #

plusCommutative :: SNat n -> SNat m -> (n :+: m) :=: (m :+: n) Source #

minusCongEq :: (n :=: m) -> SNat l -> (n :-: l) :=: (m :-: l) Source #

eqSuccMinus :: (m :<<= n) ~ True => SNat n -> SNat m -> (S n :-: m) :=: S (n :-: m) Source #

plusMinusEqL :: SNat n -> SNat m -> ((n :+: m) :-: m) :=: n Source #

plusMinusEqR :: SNat n -> SNat m -> ((m :+: n) :-: m) :=: n Source #

pluSSR :: SNat n -> SNat m -> S (n :+: m) :=: (n :+: S m) Source #

plusNeutralR :: SNat n -> SNat m -> ((n :+ m) :=: n) -> m :=: Z Source #

plusNeutralL :: SNat n -> SNat m -> ((n :+ m) :=: m) -> n :=: Z Source #

leqRhs :: Leq n m -> SNat m Source #

leqLhs :: Leq n m -> SNat n Source #

minComm :: SNat n -> SNat m -> Min n m :=: Min m n Source #

maxZL :: SNat n -> Max Z n :=: n Source #

maxComm :: SNat n -> SNat m -> Max n m :=: Max m n Source #

maxZR :: SNat n -> Max n Z :=: n Source #

Properties of ordering Leq

leqRefl :: SNat n -> Leq n n Source #

leqSucc :: SNat n -> Leq n (S n) Source #

leqTrans :: Leq n m -> Leq m l -> Leq n l Source #

plusMonotone :: Leq n m -> Leq l k -> Leq (n :+: l) (m :+: k) Source #

plusLeqL :: SNat n -> SNat m -> Leq n (n :+: m) Source #

plusLeqR :: SNat n -> SNat m -> Leq m (n :+: m) Source #

minLeqL :: SNat n -> SNat m -> Leq (Min n m) n Source #

minLeqR :: SNat n -> SNat m -> Leq (Min n m) m Source #

leqAnitsymmetric :: Leq n m -> Leq m n -> n :=: m Source #

maxLeqL :: SNat n -> SNat m -> Leq n (Max n m) Source #

maxLeqR :: SNat n -> SNat m -> Leq m (Max n m) Source #

leqSnZAbsurd :: Leq (S n) Z -> a Source #

leqnZElim :: Leq n Z -> n :=: Z Source #

leqSnLeq :: Leq (S n) m -> Leq n m Source #

leqPred :: Leq (S n) (S m) -> Leq n m Source #

leqSnnAbsurd :: Leq (S n) n -> a Source #

Useful type synonyms and constructors

type family Zero :: Nat where ... Source #

Equations

Zero = ZSym0 

type family One :: Nat where ... Source #

Equations

One = Apply SSym0 ZeroSym0 

type family Two :: Nat where ... Source #

Equations

Two = Apply SSym0 OneSym0 

type family Three :: Nat where ... Source #

Equations

Three = Apply SSym0 TwoSym0 

type family Four :: Nat where ... Source #

Equations

Four = Apply SSym0 ThreeSym0 

type family Five :: Nat where ... Source #

Equations

Five = Apply SSym0 FourSym0 

type family Six :: Nat where ... Source #

Equations

Six = Apply SSym0 FiveSym0 

type family Seven :: Nat where ... Source #

Equations

Seven = Apply SSym0 SixSym0 

type family Eight :: Nat where ... Source #

Equations

Eight = Apply SSym0 SevenSym0 

type family Nine :: Nat where ... Source #

Equations

Nine = Apply SSym0 EightSym0 

type family Ten :: Nat where ... Source #

Equations

Ten = Apply SSym0 NineSym0 

type family Eleven :: Nat where ... Source #

Equations

Eleven = Apply SSym0 TenSym0 

type family Twelve :: Nat where ... Source #

type family Thirteen :: Nat where ... Source #

type family Fourteen :: Nat where ... Source #

type family Fifteen :: Nat where ... Source #

type family Sixteen :: Nat where ... Source #

type family Seventeen :: Nat where ... Source #

type family Eighteen :: Nat where ... Source #

type family Nineteen :: Nat where ... Source #

type family Twenty :: Nat where ... Source #

type family N0 :: Nat where ... Source #

Equations

N0 = ZeroSym0 

type family N1 :: Nat where ... Source #

Equations

N1 = OneSym0 

type family N2 :: Nat where ... Source #

Equations

N2 = TwoSym0 

type family N3 :: Nat where ... Source #

Equations

N3 = ThreeSym0 

type family N4 :: Nat where ... Source #

Equations

N4 = FourSym0 

type family N5 :: Nat where ... Source #

Equations

N5 = FiveSym0 

type family N6 :: Nat where ... Source #

Equations

N6 = SixSym0 

type family N7 :: Nat where ... Source #

Equations

N7 = SevenSym0 

type family N8 :: Nat where ... Source #

Equations

N8 = EightSym0 

type family N9 :: Nat where ... Source #

Equations

N9 = NineSym0 

type family N10 :: Nat where ... Source #

Equations

N10 = TenSym0 

type family N11 :: Nat where ... Source #

Equations

N11 = ElevenSym0 

type family N12 :: Nat where ... Source #

Equations

N12 = TwelveSym0 

type family N13 :: Nat where ... Source #

Equations

N13 = ThirteenSym0 

type family N14 :: Nat where ... Source #

Equations

N14 = FourteenSym0 

type family N15 :: Nat where ... Source #

Equations

N15 = FifteenSym0 

type family N16 :: Nat where ... Source #

Equations

N16 = SixteenSym0 

type family N17 :: Nat where ... Source #

Equations

N17 = SeventeenSym0 

type family N18 :: Nat where ... Source #

Equations

N18 = EighteenSym0 

type family N19 :: Nat where ... Source #

Equations

N19 = NineteenSym0 

type family N20 :: Nat where ... Source #

Equations

N20 = TwentySym0 

type N0Sym0 = N0 Source #

type N1Sym0 = N1 Source #

type N2Sym0 = N2 Source #

type N3Sym0 = N3 Source #

type N4Sym0 = N4 Source #

type N5Sym0 = N5 Source #

type N6Sym0 = N6 Source #

type N7Sym0 = N7 Source #

type N8Sym0 = N8 Source #

type N9Sym0 = N9 Source #

Orphan instances

Preorder Nat Leq Source # 

Methods

reflexivity :: Sing Leq a -> eq a a #

transitivity :: eq a b -> eq b c -> eq a c #

Monomorphicable Nat (Sing Nat) Source # 

Associated Types

type MonomorphicRep (Sing Nat) (k1 :: Sing Nat -> *) :: * #