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