import { realFiber } from "@effect/core/io/Fiber/definition" /** * Folds over the runtime or synthetic fiber. * * @tsplus static effect/core/io/Fiber.Aspects fold * @tsplus static effect/core/io/RuntimeFiber.Aspects fold * @tsplus pipeable effect/core/io/Fiber fold * @tsplus pipeable effect/core/io/RuntimeFiber fold */ export function fold( onRuntime: (_: Fiber.Runtime) => Z, onSynthetic: (_: Fiber.Synthetic) => Z ) { return (self: Fiber): Z => { realFiber(self) switch (self._tag) { case "RuntimeFiber": { return onRuntime(self) } case "SyntheticFiber": { return onSynthetic(self) } } } }