Skip to main content

Ordering

Instances

Model

Pattern matching

Utilities

Instances

Eq

Signature

export declare const Eq: E.Eq<Ordering>

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

Monoid

Signature

export declare const Monoid: M.Monoid<Ordering>

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

Semigroup

Signature

export declare const Semigroup: S.Semigroup<Ordering>

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

Model

Ordering

Signature

export type Ordering = -1 | 0 | 1

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

Pattern matching

match

Signature

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

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

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

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

Utilities

eqOrdering

Use Eq instead

Signature

export declare const eqOrdering: E.Eq<Ordering>

Details

  • Added in 0.1.0
  • Deprecated

License

  • MIT – Copyright (c) 2017-present Giulio Canti

invert

Use reverse instead.

Signature

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

Details

  • Added in 0.1.0
  • Deprecated

License

  • MIT – Copyright (c) 2017-present Giulio Canti

monoidOrdering

Use Monoid instead

Signature

export declare const monoidOrdering: M.Monoid<Ordering>

Details

  • Added in 0.1.0
  • Deprecated

License

  • MIT – Copyright (c) 2017-present Giulio Canti

reverse

Signature

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

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

semigroupOrdering

Use Semigroup instead

Signature

export declare const semigroupOrdering: S.Semigroup<Ordering>

Details

  • Added in 0.1.0
  • Deprecated

License

  • MIT – Copyright (c) 2017-present Giulio Canti

sign

Signature

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

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti