// ets_tracing: off import * as C from "../core.js" import * as ReadWith from "./readWith.js" /** * Maps the output of this channel using f */ export function mapOut_( self: C.Channel, f: (o: OutElem) => OutElem2 ): C.Channel { const reader: C.Channel = ReadWith.readWith((i) => C.chain_(C.write(f(i)), () => reader), C.fail, C.end) return self[">>>"](reader) } /** * Maps the output of this channel using f * * @ets_data_first mapOut_ */ export function mapOut( f: (o: OutElem) => OutElem2 ): ( self: C.Channel ) => C.Channel { return (self) => mapOut_(self, f) }