effect-io-ai

Package: effect
Module: Combiner

Combiner.first

Creates a Combiner that always returns the first (left) argument.

When to use

Use when you want “first write wins” semantics while merging values.

Details

combine(self, that) returns self and ignores that.

Example (Keeping the first value)

import { Combiner } from "effect"

const First = Combiner.first<number>()

console.log(First.combine(1, 2))
// Output: 1

See

Signature

declare const first: <A>() => Combiner<A>

Source

Since v4.0.0