Table of contents


Natural (interface)

A PositiveInteger is also an Integer

Signature

export interface Natural
  extends Newtype<
    {
      Integer: true
      NonZero: true
      Positive: true
    },
    BigInteger
  > {}

add (constant)

Signature

export const add: (x: Natural, y: Natural) => Natural = ...

div (constant)

Signature

export const div: (x: Natural, y: Natural) => Natural = ...

gcd (constant)

Signature

export const gcd: (x: Natural, y: Natural) => Natural = ...

lcm (constant)

Signature

export const lcm: (x: Natural, y: Natural) => Natural = ...

mul (constant)

Signature

export const mul: (x: Natural, y: Natural) => Natural = ...

negate (constant)

Signature

export const negate: (x: Natural) => NonZeroInteger = ...

one (constant)

Signature

export const one: Natural = ...

ord (constant)

Signature

export const ord: Ord<Natural> = ...

setoid (constant)

Signature

export const setoid: Setoid<Natural> = ...

show (constant)

Signature

export const show: (x: Natural) => string = ...

unwrap (constant)

Signature

export const unwrap: (x: Natural) => BigInteger = ...

fromInteger (function)

Signature

export function fromInteger(i: Integer): Option<Natural> { ... }

sub (function)

Signature

export function sub(x: Natural, y: Natural): Option<Natural> { ... }

wrap (function)

Signature

export function wrap(x: BigInteger): Option<Natural> { ... }