Package: effect
Module: Order
Returns the minimum of two values according to the given order. If they are equal, returns the first argument.
When to use
Use when you need to select the smaller of two values according to an
Order.
Details
Returns the value that compares as less than or equal to the other value. If values are equal, the first argument is returned.
Example (Selecting the minimum value)
import { Order } from "effect"
const minNumber = Order.min(Order.Number)
console.log(minNumber(1, 2)) // 1
console.log(minNumber(2, 1)) // 1
console.log(minNumber(1, 1)) // 1
See
max for the maximum of two valuesclamp to clamp a value between min and maxSignature
declare const min: <A>(O: Order<A>) => { (that: A): (self: A) => A; (self: A, that: A): A; }
Since v2.0.0