// ets_tracing: off import * as C from "../core.js" import * as ReadWith from "./readWith.js" import * as ZipRight from "./zipRight.js" function contramapInReader( f: (a: InElem0) => InElem ): C.Channel { return ReadWith.readWith( (_in) => ZipRight.zipRight_(C.write(f(_in)), contramapInReader(f)), (err) => C.fail(err), (done) => C.end(done) ) } export function contramapIn_< Env, InErr, InElem0, InElem, InDone, OutErr, OutElem, OutDone >( self: C.Channel, f: (a: InElem0) => InElem ): C.Channel { return C.pipeTo_(contramapInReader(f), self) } /** * @ets_data_first contramapIn_ */ export function contramapIn(f: (a: InElem0) => InElem) { return ( self: C.Channel ) => contramapIn_(self, f) }