Closed giogonzo closed 5 years ago
return (low: A, hi?: A, x?: A) => {
if (hi === undefined) {
}
}
@giogonzo there's a possible corner case when A = undefined
This test is somehow passing already:
const ordUndefined: Ord<undefined> = {
equals: (a, b) => a === b,
compare: () => 0
};
expect(
JSONEqual(
R.clamp(undefined, undefined, undefined),
FR.clamp(ordUndefined)(undefined, undefined, undefined)
)
).toBe(true);
yes, it fails without the JSON.stringify
:
expected: undefined
received: [Function]
@gcanti added support for it in the last commit, but it has a perf cost. Probably it can be improved by switching back to function
instead of () =>
and accessing arguments.length
Tracking further perf improvements in #13
@gcanti I think this is ready to go, care to take a look?