effect-io-ai

Package: effect
Module: Combiner

Combiner.make

Creates a Combiner from a binary function.

When to use

Use when you have a custom combining operation that is not covered by the built-in constructors (min, max, first, last, constant).

Details

The returned combiner’s combine method delegates to the provided function. Any purity, associativity, or mutation behavior comes from that function.

Example (Multiplying numbers)

import { Combiner } from "effect"

const Product = Combiner.make<number>((self, that) => self * that)

console.log(Product.combine(3, 5))
// Output: 15

See

Signature

declare const make: <A>(combine: (self: A, that: A) => A) => Combiner<A>

Source

Since v4.0.0