MCPcopy Create free account
hub / github.com/Effect-TS/effect / makeCombiner

Function makeCombiner

packages/effect/src/Tuple.ts:672–682  ·  view source on GitHub ↗
(
  combiners: { readonly [K in keyof A]: Combiner.Combiner<A[K]> }
)

Source from the content-addressed store, hash-verified

670 * @since 4.0.0
671 */
672export function makeCombiner<A extends ReadonlyArray<unknown>>(
673 combiners: { readonly [K in keyof A]: Combiner.Combiner<A[K]> }
674): Combiner.Combiner<A> {
675 return Combiner.make((self, that) => {
676 const out = []
677 for (let i = 0; i < self.length; i++) {
678 out.push(combiners[i].combine(self[i], that[i]))
679 }
680 return out as any
681 })
682}
683
684/**
685 * Creates a `Reducer` for a tuple shape by providing a `Reducer` for each

Callers 1

makeReducerFunction · 0.70

Calls 3

pushMethod · 0.80
makeMethod · 0.65
combineMethod · 0.65

Tested by

no test coverage detected