Nat — Natural numbers

Most operations on natural numbers (e.g. addition) are available as built-in operators (1 + 1). This module provides conversion functions.

The conversions toNat* will trap if the number is out of bounds; the conversions toWord* will wrap-around.

toText

toText : Nat -> Text

fromWord8

fromWord8 : Word8  -> Nat

fromWord16

fromWord16 : Word16 -> Nat

fromWord32

fromWord32 : Word32 -> Nat

fromWord64

fromWord64 : Word64 -> Nat

toWord8

toWord8 : Nat -> Word8

toWord16

toWord16 : Nat -> Word16

toWord32

toWord32 : Nat -> Word32

toWord64

toWord64 : Nat -> Word64

fromNat8

fromNat8 : Nat8  -> Nat

fromNat16

fromNat16 : Nat16 -> Nat

fromNat32

fromNat32 : Nat32 -> Nat

fromNat64

fromNat64 : Nat64 -> Nat

toNat8

toNat8 : Nat -> Nat8

toNat16

toNat16 : Nat -> Nat16

toNat32

toNat32 : Nat -> Nat32

toNat64

toNat64 : Nat -> Nat64

min

min : (Nat, Nat) -> Nat

max

max : (Nat, Nat) -> Nat