// ets_tracing: off import { chain_ } from "./core.js" import type { Effect } from "./effect.js" import { map_ } from "./map.js" /** * Returns an effect that effectfully "peeks" at the success of this effect. * * @ets_data_first tap_ */ export function tap( f: (_: A) => Effect, __trace?: string ): (_: Effect) => Effect { return (fa) => tap_(fa, f, __trace) } /** * Returns an effect that effectfully "peeks" at the success of this effect. */ export function tap_( _: Effect, f: (_: A) => Effect, __trace?: string ) { return chain_(_, (a: A) => map_(f(a), () => a), __trace) }