witness-0.6.2: values that witness types
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.PeanoNat

Synopsis

Documentation

data PeanoNat Source #

Inductive natural numbers.

Constructors

Zero 
Succ PeanoNat 

type family Add a b where ... Source #

Equations

Add 'Zero b = b 
Add ('Succ a) b = 'Succ (Add a b) 

subtractFromPeanoNat :: PeanoNat -> PeanoNat -> Maybe PeanoNat Source #

subtractFromPeanoNat a b = b - a

type family PeanoToNatural pn where ... Source #

Equations

PeanoToNatural 'Zero = 0 
PeanoToNatural ('Succ pn) = PeanoToNatural pn + 1 

type family ListLength l where ... Source #

Equations

ListLength '[] = 'Zero 
ListLength (a ': aa) = 'Succ (ListLength aa)