UNPKG
@prelude/cmp
Version:
latest (4.2.0)
4.2.0
4.1.0
4.0.0
3.0.0
2.0.0
1.5.0
1.4.3
1.4.2
1.4.1
1.4.0
1.3.1
1.3.0
1.2.0
1.1.0
1.0.0
0.1.4
0.1.3
0.1.2
0.1.1
0.1.0
0.0.2
Cmp module.
@prelude/cmp
/
src
/
of-lt.ts
14 lines
(11 loc)
•
290 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import
{
type
R, asc, eq, dsc }
from
'./prelude.js'
/**
@returns
comparision function from lower-than function. */
const
ofLt = <T>
(
lt
: (a: T, b: T) =>
boolean
) =>
(
a
: T,
b
: T):
R
=>
lt
(a, b) ? asc :
lt
(b, a) ? dsc : eq
export
default
ofLt