// 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 contramapInMReader( f: (a: InElem0) => T.Effect ): C.Channel { return ReadWith.readWith( (_in) => ZipRight.zipRight_( C.chain_(C.fromEffect(f(_in)), (_) => C.write(_)), contramapInMReader(f) ), (err) => C.fail(err), (done) => C.end(done) ) } export function contramapInEffect_< Env, Env1, InErr, InElem0, InElem, InDone, OutErr, OutElem, OutDone >( self: C.Channel, f: (a: InElem0) => T.Effect ): C.Channel { return C.pipeTo_(contramapInMReader(f), self) } /** * @ets_data_first contramapInEffect_ */ export function contramapInEffect( f: (a: InElem0) => T.Effect ) { return ( self: C.Channel ) => contramapInEffect_(self, f) }