// ets_tracing: off import type * as T from "../../../../Effect/index.js" import * as C from "../core.js" import * as ReadWith from "./readWith.js" import * as ZipRight from "./zipRight.js" const mapOutMReader = ( f: (o: OutElem) => T.Effect ): C.Channel< Env & Env1, OutErr, OutElem, OutDone, OutErr | OutErr1, OutElem1, OutDone > => ReadWith.readWith( (out) => ZipRight.zipRight_( C.chain_(C.fromEffect(f(out)), (_) => C.write(_)), mapOutMReader(f) ), (e) => C.fail(e), (z) => C.end(z) ) export function mapOutEffect_< Env, Env1, InErr, InElem, InDone, OutErr, OutErr1, OutElem, OutElem1, OutDone >( self: C.Channel, f: (o: OutElem) => T.Effect ): C.Channel { return C.pipeTo_(self, mapOutMReader(f)) } /** * @ets_data_first mapOutEffect_ */ export function mapOutEffect( f: (o: OutElem) => T.Effect ) { return ( self: C.Channel ) => mapOutEffect_(self, f) }