Hyperlinkv0.8.0-beta.28

Combiner

Combiner.firstfunctioneffect/Combiner.ts:215
<A>(): Combiner<A>

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
constructorslast
export function first<A>(): Combiner<A> {
  return make((self, _) => self)
}