<A>(combiner: Combiner.Combiner<A>): Combiner.Combiner<A | undefined>Creates a Combiner for A | undefined that combines values only when both
operands are defined.
When to use
Use to lift a Combiner so any undefined operand makes the combined result
undefined.
Details
undefinedcombined with any value returnsundefined- Any value combined with
undefinedreturnsundefined acombined withbreturnscombiner.combine(a, b)
constructorsmakeReducerFailFast
Source effect/UndefinedOr.ts:2006 lines
export function function makeCombinerFailFast<A>(
combiner: Combiner.Combiner<A>
): Combiner.Combiner<A | undefined>
Creates a Combiner for A | undefined that combines values only when both
operands are defined.
When to use
Use to lift a Combiner so any undefined operand makes the combined result
undefined.
Details
undefined combined with any value returns undefined
- Any value combined with
undefined returns undefined
a combined with b returns combiner.combine(a, b)
makeCombinerFailFast<function (type parameter) A in makeCombinerFailFast<A>(combiner: Combiner.Combiner<A>): Combiner.Combiner<A | undefined>A>(combiner: Combiner.Combiner<A>(parameter) combiner: {
combine: (self: A, that: A) => A;
}
combiner: import CombinerCombiner.type Combiner.Combiner = /*unresolved*/ anyCombiner<function (type parameter) A in makeCombinerFailFast<A>(combiner: Combiner.Combiner<A>): Combiner.Combiner<A | undefined>A>): import CombinerCombiner.type Combiner.Combiner = /*unresolved*/ anyCombiner<function (type parameter) A in makeCombinerFailFast<A>(combiner: Combiner.Combiner<A>): Combiner.Combiner<A | undefined>A | undefined> {
return import CombinerCombiner.make((self: anyself, that: anythat) => {
if (self: anyself === var undefinedundefined || that: anythat === var undefinedundefined) return var undefinedundefined
return combiner: Combiner.Combiner<A>(parameter) combiner: {
combine: (self: A, that: A) => A;
}
combiner.combine(self: anyself, that: anythat)
})
}Referenced by 1 symbols