Hyperlinkv0.8.0-beta.28

BigInt

BigInt.sumconsteffect/BigInt.ts:102
(that: bigint): (self: bigint) => bigint
(self: bigint, that: bigint): bigint

Provides an addition operation on bigints.

When to use

Use when you need a binary addition function for piping or higher-order APIs instead of the infix addition operator.

Example (Adding bigints)

import { BigInt } from "effect"
import * as assert from "node:assert"

assert.deepStrictEqual(BigInt.sum(2n, 3n), 5n)
mathsumAll
Source effect/BigInt.ts:1024 lines
export const sum: {
  (that: bigint): (self: bigint) => bigint
  (self: bigint, that: bigint): bigint
} = dual(2, (self: bigint, that: bigint): bigint => self + that)