Table of contents
clamp (function)
Similar to R.clamp, but:
- requires an explicit
Ord<A>
instance, thus it supports anyA
not just “JS ordered types” - doesn’t throw if
min > max
(returnsmin
instead)
Signature
export function clamp<A>(
O: Ord<A>
): {
(low: A): {
(hi: A): (x: A) => A;
(hi: A, x: A): A;
};
(low: A, hi: A): (x: A) => A;
(low: A, hi: A, x: A): A;
}; { ... }
Added in v0.1.2