UNPKG

@prelude/cmp

Version:

Cmp module.

17 lines (16 loc) 642 B
/** Comparision result type. */ export type R = -1 | 0 | 1; /** Comparision function type. */ export type Cmp<Lhs, Rhs = Lhs> = (lhs: Lhs, rhs: Rhs) => R; /** Curried comparision function type. */ export type Cmp1<T> = (a: T) => R; /** Comparision function type. */ export type t<Lhs, Rhs = Lhs> = Cmp<Lhs, Rhs>; export type Tail<T> = T extends [_: unknown, ...tail: infer R] ? R : never; /** Equal comparision result. */ export declare const eq: R; /** Ascending comparision result. */ export declare const asc: R; /** Descending comparision result. */ export declare const dsc: R; export type Value<T> = T extends Cmp<infer U> ? U : never;