Link Search Menu Expand Document

UInt8 overview

Added in v1.0.0


Table of contents


Constructor

fromNumber

Attempts to construct a [[UInt8]] from a number, computing none if the number is not an integer in the bounds of UInt8, otherwise some(n).

Signature

export declare function fromNumber(n: number): option.Option<UInt8>

Added in v1.0.0

fromNumberLossy

Constructs a [[UInt8]] from a number, wrapping the value if it overflows the range of [[UInt8]].

Signature

export declare function fromNumberLossy(n: number): UInt8

Added in v1.0.0

of

Constructs a UInt8 from [[Digits]]

Signature

export declare function of(zero: 0): UInt8
export declare function of(...digits: Digits): NonZero<UInt8>

Added in v1.0.0

unsafeFromNumber

Attempts to construct a [[UInt8]] from a number, throwing a RangeError if the number is not an integer in the bounds of UInt8.

Signature

export declare function unsafeFromNumber(n: number): UInt8

Added in v1.0.0

Data Type

UInt8 (interface)

Signature

export interface UInt8 extends Branded<NonNegative<UInt16>, typeof U_INT_8> {}

Added in v1.0.0

Transformation

toNumber

Signature

export declare function toNumber(n: UInt8): number

Added in v1.0.0

Type Guard

isTypeOf

Signature

export declare function isTypeOf(x: unknown): x is UInt8

Added in v1.0.0

Typeclass Instance

Bounded

Signature

export declare const Bounded: Bounded<UInt8>

Added in v1.0.0

CommutativeRing

Signature

export declare const CommutativeRing: CommutativeRing<UInt8>

Added in v1.0.0

Enum

Signature

export declare const Enum: Enum<UInt8>

Added in v1.0.0

Eq

Signature

export declare const Eq: Eq<UInt8>

Added in v1.0.0

EuclideanRing

Signature

export declare const EuclideanRing: EuclideanRing<UInt8>

Added in v1.0.0

HasPow

Signature

export declare const HasPow: HasPow<UInt8>

Added in v1.0.0

HasToInt

Signature

export declare const HasToInt: HasToInt<UInt8>

Added in v1.0.0

HasToRational

Signature

export declare const HasToRational: HasToRational<UInt8>

Added in v1.0.0

Integral

Signature

export declare const Integral: Integral<UInt8>

Added in v1.0.0

Numeric

Signature

export declare const Numeric: Numeric<UInt8>

Added in v1.0.0

Ord

Signature

export declare const Ord: Ord<UInt8>

Added in v1.0.0

Ring

Signature

export declare const Ring: Ring<UInt8>

Added in v1.0.0

Semiring

Signature

export declare const Semiring: Semiring<UInt8>

Added in v1.0.0

Show

Signature

export declare const Show: Show<UInt8>

Added in v1.0.0

utils

Digits (type alias)

A tuple of literal integers representing every valid sequence of digits for [[UInt8]]

Signature

export type Digits =
  | [0]
  | [LeadingDigit]
  | [LeadingDigit, Digit]
  | [1, Digit, Digit]
  | [2, 0 | 1 | 2 | 3 | 4, Digit]
  | [2, 5, 0 | 1 | 2 | 3 | 4 | 5]

Added in v1.0.0

UInt8

Signature

export declare const UInt8: Bounded<UInt8> &
  CommutativeRing<UInt8> &
  Enum<UInt8> &
  Eq<UInt8> &
  EuclideanRing<UInt8> &
  HasPow<UInt8> &
  HasToInt<UInt8> &
  HasToRational<UInt8> &
  Integral<UInt8> &
  Numeric<UInt8> &
  Ord<UInt8> &
  Ring<UInt8> &
  Semiring<UInt8> &
  Show<UInt8> & {
    add: typeof add
    bottom: UInt8
    compare: (x: UInt8, y: UInt8) => Ordering
    div: typeof div
    equals: typeof equals
    fromInt: typeof fromInt
    fromNumber: typeof fromNumber
    fromNumberLossy: typeof fromNumberLossy
    isTypeOf: typeof isTypeOf
    mod: typeof mod
    mul: typeof mul
    next: typeof next
    of: typeof of
    one: UInt8
    pow: typeof pow
    prev: typeof prev
    quot: typeof quot
    rem: typeof rem
    sub: typeof sub
    toInt: typeof toInt
    toNonNegativeNumber: typeof toNumber
    top: UInt8
    toRational: typeof toRational
    unsafeFromNumber: typeof unsafeFromNumber
    zero: UInt8
  }

Added in v1.0.0

add

Signature

export declare function add(a: UInt8, b: UInt8): UInt8

Added in v1.0.0

bottom

Signature

export declare const bottom: UInt8

Added in v1.0.0

compare

Signature

export declare const compare: (x: UInt8, y: UInt8) => Ordering

Added in v1.0.0

degree

Signature

export declare function degree(i: UInt8): Natural

Added in v1.0.0

div

Signature

export declare function div(n: UInt8, d: NonZero<UInt8>): UInt8

Added in v1.0.0

equals

Signature

export declare function equals(a: UInt8, b: UInt8): boolean

Added in v1.0.0

fromInt

Signature

export declare function fromInt(int: Int): Option<UInt8>

Added in v1.0.0

mod

Signature

export declare function mod(n: UInt8, d: NonZero<UInt8>): UInt8

Added in v1.0.0

mul

Signature

export declare function mul(a: UInt8, b: UInt8): UInt8

Added in v1.0.0

next

Signature

export declare function next(a: UInt8): Option<UInt8>

Added in v1.0.0

one

Signature

export declare const one: UInt8

Added in v1.0.0

pow

Signature

export declare function pow(n: UInt8, exp: UInt8): UInt8

Added in v1.0.0

prev

Signature

export declare function prev(a: UInt8): Option<UInt8>

Added in v1.0.0

quot

Signature

export declare function quot(a: UInt8, b: NonZero<UInt8>): UInt8

Added in v1.0.0

rem

Signature

export declare function rem(a: UInt8, b: NonZero<UInt8>): UInt8

Added in v1.0.0

sub

Signature

export declare function sub(a: UInt8, b: UInt8): UInt8

Added in v1.0.0

toInt

Signature

export declare function toInt(n: UInt8): Int

Added in v1.0.0

toRational

Signature

export declare function toRational(a: UInt8): Rational

Added in v1.0.0

top

Signature

export declare const top: UInt8

Added in v1.0.0

zero

Signature

export declare const zero: UInt8

Added in v1.0.0