// ets_tracing: off import * as CS from "../../../../Cause/index.js" import * as E from "../../../../Either/index.js" import * as C from "../core.js" /** * Reads an input and continue exposing both error and completion */ export function readWith< Env, Env1, Env2, InErr, InElem, InDone, OutErr, OutErr1, OutErr2, OutElem, OutElem1, OutElem2, OutDone, OutDone1, OutDone2 >( inp: (i: InElem) => C.Channel, error: ( e: InErr ) => C.Channel, done: ( d: InDone ) => C.Channel ): C.Channel< Env & Env1 & Env2, InErr, InElem, InDone, OutErr | OutErr1 | OutErr2, OutElem | OutElem1 | OutElem2, OutDone | OutDone1 | OutDone2 > { return C.readWithCause( inp, (c) => E.fold_(CS.failureOrCause(c), error, C.failCause), done ) }