effect-io-ai

Package: effect
Module: BigInt

BigInt.sumAll

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

Signature

declare const sumAll: (collection: Iterable<bigint>) => bigint

Source

Since v2.0.0