(that: bigint): (self: bigint) => boolean
(self: bigint, that: bigint): booleanReturns a function that checks if a given bigint is less than or equal to the provided one.
When to use
Use to test whether one bigint is less than or equal to another.
Example (Checking less-than-or-equal comparisons)
import { BigInt } from "effect"
import * as assert from "node:assert"
assert.deepStrictEqual(BigInt.isLessThanOrEqualTo(2n, 3n), true)
assert.deepStrictEqual(BigInt.isLessThanOrEqualTo(3n, 3n), true)
assert.deepStrictEqual(BigInt.isLessThanOrEqualTo(4n, 3n), false)export const const isLessThanOrEqualTo: {
(that: bigint): (self: bigint) => boolean
(self: bigint, that: bigint): boolean
}
Returns a function that checks if a given bigint is less than or equal to the provided one.
When to use
Use to test whether one bigint is less than or equal to another.
Example (Checking less-than-or-equal comparisons)
import { BigInt } from "effect"
import * as assert from "node:assert"
assert.deepStrictEqual(BigInt.isLessThanOrEqualTo(2n, 3n), true)
assert.deepStrictEqual(BigInt.isLessThanOrEqualTo(3n, 3n), true)
assert.deepStrictEqual(BigInt.isLessThanOrEqualTo(4n, 3n), false)
isLessThanOrEqualTo: {
(that: bigintthat: bigint): (self: bigintself: bigint) => boolean
(self: bigintself: bigint, that: bigintthat: bigint): boolean
} = import orderorder.const isLessThanOrEqualTo: <A>(
O: Order<A>
) => {
(that: A): (self: A) => boolean
(self: A, that: A): boolean
}
Checks whether one value is less than or equal to another according to the given order.
When to use
Use when you need a boolean less-than-or-equal predicate using an Order.
Details
Returns true if the order returns -1 or 0, and returns false only if
the order returns 1.
Example (Checking less-than-or-equal comparisons)
import { Order } from "effect"
const isLessThanOrEqualToNumber = Order.isLessThanOrEqualTo(Order.Number)
console.log(isLessThanOrEqualToNumber(1, 2)) // true
console.log(isLessThanOrEqualToNumber(1, 1)) // true
console.log(isLessThanOrEqualToNumber(2, 1)) // false
isLessThanOrEqualTo(const Order: order.Order<bigint>Provides an Order instance for bigint that allows comparing and sorting BigInt values.
When to use
Use when you need to sort or compare bigint values through APIs that accept
an ordering instance.
Example (Comparing bigints with Order)
import { BigInt } from "effect"
const a = 123n
const b = 456n
const c = 123n
console.log(BigInt.Order(a, b)) // -1 (a < b)
console.log(BigInt.Order(b, a)) // 1 (b > a)
console.log(BigInt.Order(a, c)) // 0 (a === c)
Order)