Combiner.Combiner<bigint>Combiner that returns the minimum bigint.
When to use
Use to keep the smallest bigint through APIs that consume a Combiner.
export const const CombinerMin: Combiner.Combiner<bigint>const CombinerMin: {
combine: (self: A, that: A) => A;
}
Combiner that returns the minimum bigint.
When to use
Use to keep the smallest bigint through APIs that consume a Combiner.
CombinerMin: import CombinerCombiner.interface Combiner<A>Represents a strategy for combining two values of the same type A. A
Combiner contains a single combine method that takes two values and
returns a merged result. It does not include an identity/empty value; use
Reducer when you need one.
When to use
Use when you need to describe how two values of the same type
merge, pass a reusable combining strategy to library functions like
Struct.makeCombiner or Option.makeCombinerFailFast, or define the
combining step for a Reducer.
Example (Combining numbers with addition)
import { Combiner } from "effect"
const Sum = Combiner.make<number>((self, that) => self + that)
console.log(Sum.combine(3, 4))
// Output: 7
Combiner<bigint> = import CombinerCombiner.function min<A>(
order: Order.Order<A>
): Combiner<A>
Creates a Combiner that returns the smaller of two values according to
the provided Order.
When to use
Use when you want to accumulate the minimum value across a collection or
build a Reducer that tracks the running minimum.
Details
The combiner compares values using the given Order. When values are equal,
it returns that (the second argument).
Example (Selecting the minimum of two numbers)
import { Combiner, Number } from "effect"
const Min = Combiner.min(Number.Order)
console.log(Min.combine(3, 1))
// Output: 1
console.log(Min.combine(1, 3))
// Output: 1
min(const Order: order.Order<bigint>Provides an Order instance for bigint that allows comparing and sorting BigInt values.
When to use
Use when you need to sort or compare bigint values through APIs that accept
an ordering instance.
Example (Comparing bigints with Order)
import { BigInt } from "effect"
const a = 123n
const b = 456n
const c = 123n
console.log(BigInt.Order(a, b)) // -1 (a < b)
console.log(BigInt.Order(b, a)) // 1 (b > a)
console.log(BigInt.Order(a, c)) // 0 (a === c)
Order)