moy-fp
Version:
A functional programming library.
18 lines (15 loc) • 352 B
JavaScript
import __ from '../../src/Function/__'
/**
* ((a, a) -> Number) -> [a] -> [a]
*/
import sort from '../../src/List/sort'
test('sort(not using __)', () => {
expect(
sort((a, b) => b - a)([1, 2, 3, 4])
).toEqual([4, 3, 2, 1])
})
test('sort(using __)', () => {
expect(
sort(__, [1, 2, 3, 4])((a, b) => b - a)
).toEqual([4, 3, 2, 1])
})