MCPcopy Index your code
hub / github.com/Effect-TS/effect / linearize

Function linearize

packages/effect/src/internal/cause.ts:300–310  ·  view source on GitHub ↗
(self: Cause.Cause<E>)

Source from the content-addressed store, hash-verified

298
299/** @internal */
300export const linearize = <E>(self: Cause.Cause<E>): HashSet.HashSet<Cause.Cause<E>> =>
301 match(self, {
302 onEmpty: HashSet.empty(),
303 onFail: (error) => HashSet.make(fail(error)),
304 onDie: (defect) => HashSet.make(die(defect)),
305 onInterrupt: (fiberId) => HashSet.make(interrupt(fiberId)),
306 onSequential: (leftSet, rightSet) =>
307 HashSet.flatMap(leftSet, (leftCause) => HashSet.map(rightSet, (rightCause) => sequential(leftCause, rightCause))),
308 onParallel: (leftSet, rightSet) =>
309 HashSet.flatMap(leftSet, (leftCause) => HashSet.map(rightSet, (rightCause) => parallel(leftCause, rightCause)))
310 })
311
312/** @internal */
313export const stripFailures = <E>(self: Cause.Cause<E>): Cause.Cause<never> =>

Callers

nothing calls this directly

Calls 8

matchFunction · 0.70
failFunction · 0.70
dieFunction · 0.70
interruptFunction · 0.70
sequentialFunction · 0.70
parallelFunction · 0.70
makeMethod · 0.65
mapMethod · 0.65

Tested by

no test coverage detected