obiloud/numeric-decimal/3.0.0

NOTE: the latest version is 3.0.1

Numeric.Nat

Definition

type Nat

Naturals with zero.

Conversion

fromIntAbs : Int -> Nat

Nat from Int absolute value.

fromIntAbs 2 -- (Nat 2)


fromIntAbs -3 -- (Nat 3)

Nat from positive Ints, otherwise 0

fromIntAbs 2 -- (Nat 2)


fromIntAbs -3 -- (Nat 0)
toInt : Nat -> Int

toInt Nat

Arithmetic

add : Nat -> Nat -> Nat

Add two Nats.

Primitives

Nat 0

Nat 1

Nat 2

Nat 3

Nat 4

Nat 5

Increment by 1