(that: bigint): (self: bigint) => boolean
(self: bigint, that: bigint): booleanReturns true if the first argument is less than the second, otherwise false.
When to use
Use to test whether one bigint is strictly less than another.
Example (Checking less-than comparisons)
import { BigInt } from "effect"
import * as assert from "node:assert"
assert.deepStrictEqual(BigInt.isLessThan(2n, 3n), true)
assert.deepStrictEqual(BigInt.isLessThan(3n, 3n), false)
assert.deepStrictEqual(BigInt.isLessThan(4n, 3n), false)export const const isLessThan: {
(that: bigint): (self: bigint) => boolean
(self: bigint, that: bigint): boolean
}
Returns true if the first argument is less than the second, otherwise false.
When to use
Use to test whether one bigint is strictly less than another.
Example (Checking less-than comparisons)
import { BigInt } from "effect"
import * as assert from "node:assert"
assert.deepStrictEqual(BigInt.isLessThan(2n, 3n), true)
assert.deepStrictEqual(BigInt.isLessThan(3n, 3n), false)
assert.deepStrictEqual(BigInt.isLessThan(4n, 3n), false)
isLessThan: {
(that: bigintthat: bigint): (self: bigintself: bigint) => boolean
(self: bigintself: bigint, that: bigintthat: bigint): boolean
} = import orderorder.const isLessThan: <A>(O: Order<A>) => {
(that: A): (self: A) => boolean
(self: A, that: A): boolean
}
Checks whether one value is strictly less than another according to the given order.
When to use
Use when you need a boolean less-than predicate using an Order.
Details
Returns true if the order returns -1, meaning the first value is less
than the second. Equal or greater values return false.
Example (Checking less-than comparisons)
import { Order } from "effect"
const isLessThanNumber = Order.isLessThan(Order.Number)
console.log(isLessThanNumber(1, 2)) // true
console.log(isLessThanNumber(2, 1)) // false
console.log(isLessThanNumber(1, 1)) // false
isLessThan(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)