// 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" function contramapMReader( f: (i: InDone0) => T.Effect ): C.Channel { return ReadWith.readWith( (_in) => ZipRight.zipRight_(C.write(_in), contramapMReader(f)), (err) => C.fail(err), (done0) => C.fromEffect(f(done0)) ) } export function contramapEffect_< Env, Env1, InErr, InElem, InDone0, InDone, OutErr, OutElem, OutDone >( self: C.Channel, f: (i: InDone0) => T.Effect ): C.Channel { return C.pipeTo_(contramapMReader(f), self) } /** * @ets_data_first contramapEffect_ */ export function contramapEffect( f: (i: InDone0) => T.Effect ) { return ( self: C.Channel ) => contramapEffect_(self, f) }