Package: effect
Module: Option
Creates a Combiner for Option<A> with fail-fast semantics: returns None
if either operand is None.
When to use
Use when you need an Option combiner that returns None unless both
operands are Some.
Details
None + anything → NoneNone → NoneSome(a) + Some(b) → Some(combine(a, b))Example (Fail-fast combining)
import { Number, Option } from "effect"
const combiner = Option.makeCombinerFailFast(Number.ReducerSum)
console.log(combiner.combine(Option.some(1), Option.some(2)))
// Output: { _id: 'Option', _tag: 'Some', value: 3 }
console.log(combiner.combine(Option.some(1), Option.none()))
// Output: { _id: 'Option', _tag: 'None' }
See
makeReducerFailFast to get a full ReducerSignature
declare const makeCombinerFailFast: <A>(combiner: Combiner.Combiner<A>) => Combiner.Combiner<Option<A>>
Since v4.0.0