Hyperlinkv0.8.0-beta.28

Order

Order.BigIntconsteffect/Order.ts:238
(self: bigint, that: bigint): Ordering

Order instance for bigints that compares them numerically.

When to use

Use when you need numeric ordering for bigint values.

Details

Uses standard numeric comparison for bigint values and handles arbitrarily large integers.

Example (Ordering BigInts)

import { Order } from "effect"

console.log(Order.BigInt(1n, 2n)) // -1
console.log(Order.BigInt(2n, 1n)) // 1
console.log(Order.BigInt(1n, 1n)) // 0
Source effect/Order.ts:2381 lines
export const BigInt: Order<bigint> = make((self, that) => self < that ? -1 : 1)
Referenced by 8 symbols