Ordering overview

Added in v2.0.0


Table of contents


instances

Eq

Signature

export declare const Eq: E.Eq<Ordering>

Added in v2.10.0

Monoid

Signature

export declare const Monoid: M.Monoid<Ordering>

Added in v2.10.0

Semigroup

Signature

export declare const Semigroup: S.Semigroup<Ordering>

Added in v2.10.0

model

Ordering (type alias)

Signature

export type Ordering = -1 | 0 | 1

Added in v2.0.0

pattern matching

match

Signature

export declare const match: <A>(onLessThan: () => A, onEqual: () => A, onGreaterThan: () => A) => (o: Ordering) => A

Added in v2.10.0

matchW

Less strict version of match.

The W suffix (short for Widening) means that the handler return types will be merged.

Signature

export declare const matchW: <A, B, C>(
  onLessThan: () => A,
  onEqual: () => B,
  onGreaterThan: () => C
) => (o: Ordering) => A | B | C

Added in v2.12.0

utils

reverse

Signature

export declare const reverse: (o: Ordering) => Ordering

Added in v2.10.0

sign

Signature

export declare const sign: (n: number) => Ordering

Added in v2.0.0

zone of death

eqOrdering

Use Eq instead

Signature

export declare const eqOrdering: E.Eq<Ordering>

Added in v2.0.0

invert

Use reverse instead.

Signature

export declare const invert: (o: Ordering) => Ordering

Added in v2.0.0

monoidOrdering

Use Monoid instead

Signature

export declare const monoidOrdering: M.Monoid<Ordering>

Added in v2.4.0

semigroupOrdering

Use Semigroup instead

Signature

export declare const semigroupOrdering: S.Semigroup<Ordering>

Added in v2.0.0