Skip to main content Link Search Menu Expand Document (external link)

BigInt overview

Added in v0.24.0


Table of contents


instances

MonoidMultiply

bigint monoid under multiplication.

The empty value is 1n.

Signature

export declare const MonoidMultiply: monoid.Monoid<bigint>

Example

import { MonoidMultiply } from "@effect/typeclass/data/BigInt"

assert.deepStrictEqual(MonoidMultiply.combine(2n, 3n), 6n)
assert.deepStrictEqual(MonoidMultiply.combine(2n, MonoidMultiply.empty), 2n)

Added in v0.24.0

MonoidSum

bigint monoid under addition.

The empty value is 0n.

Signature

export declare const MonoidSum: monoid.Monoid<bigint>

Example

import { MonoidSum } from "@effect/typeclass/data/BigInt"

assert.deepStrictEqual(MonoidSum.combine(2n, 3n), 5n)
assert.deepStrictEqual(MonoidSum.combine(2n, MonoidSum.empty), 2n)

Added in v0.24.0

SemigroupMax

A Semigroup that uses the maximum between two values.

Signature

export declare const SemigroupMax: semigroup.Semigroup<bigint>

Example

import { SemigroupMax } from "@effect/typeclass/data/BigInt"

assert.deepStrictEqual(SemigroupMax.combine(2n, 3n), 3n)

Added in v0.24.0

SemigroupMin

A Semigroup that uses the minimum between two values.

Signature

export declare const SemigroupMin: semigroup.Semigroup<bigint>

Example

import { SemigroupMin } from "@effect/typeclass/data/BigInt"

assert.deepStrictEqual(SemigroupMin.combine(2n, 3n), 2n)

Added in v0.24.0

SemigroupMultiply

bigint semigroup under multiplication.

Signature

export declare const SemigroupMultiply: semigroup.Semigroup<bigint>

Added in v0.24.0

SemigroupSum

bigint semigroup under addition.

Signature

export declare const SemigroupSum: semigroup.Semigroup<bigint>

Example

import { SemigroupSum } from "@effect/typeclass/data/BigInt"

assert.deepStrictEqual(SemigroupSum.combine(2n, 3n), 5n)

Added in v0.24.0