Module

Data.Natural

#intToNat

intToNat :: Int -> Natural

Construct a natural number from an integer. If the integer is less than 0, then the result will be 0 (nat)

#natToInt

natToInt :: Natural -> Int

Convert a natural number back to an integer

#minus

minus :: Natural -> Natural -> Natural

Subtract a natural number from another. When l < r then l +- r = 0. This is provided due to Natural not being a Ring as it violates the additive inverse law: a - a = (zero - a) + a = zero

#(+-)

Operator alias for Data.Natural.minus (left-associative / precedence 6)

Modules