Hyperlinkv0.8.0-beta.28

BigInt

BigInt.Orderconsteffect/BigInt.ts:298
(self: bigint, that: bigint): Ordering

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)
instances
Source effect/BigInt.ts:2981 lines
export const Order: order.Order<bigint> = order.BigInt
Referenced by 10 symbols