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