Package: effect
Module: BigInt
Takes an Iterable of bigints and returns their sum as a single bigint. Returns 0n for an empty iterable.
When to use
Use when you want an immediate aggregate from an iterable instead of a folding reducer owned by another API.
Example (Summing iterable bigints)
import { BigInt } from "effect"
import * as assert from "node:assert"
assert.deepStrictEqual(BigInt.sumAll([2n, 3n, 4n]), 9n)
See
sum for adding two bigint valuesReducerSum for summing through APIs that consume a ReducerSignature
declare const sumAll: (collection: Iterable<bigint>) => bigint
Since v2.0.0