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

Function linearize

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

Source from the content-addressed store, hash-verified

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