Module

Data.Natural

Package
purescript-naturals
Repository
LiamGoodacre/purescript-naturals

#intToNat Source

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 Source

natToInt :: Natural -> Int

Convert a natural number back to an integer

#minus Source

minus :: Natural -> Natural -> Natural

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

#(+-) Source

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

Modules
Data.Natural