import * as tsplus_module_1 from "@tsplus/stdlib/data/Tuple/make";
import * as tsplus_module_2 from "@effect/core/io/Effect/operations/map";
import * as tsplus_module_3 from "@effect/core/io/Effect/operations/flatMap";
import * as tsplus_module_4 from "@effect/core/io/Effect/operations/succeed";
/**
 * Summarizes a effect by computing some value before and after execution, and
 * then combining the values to produce a summary, together with the result of
 * execution.
 *
 * @tsplus fluent ets/Effect summarized
 */

export function summarized_(self, summary, f, __tsplusTrace) {
  return tsplus_module_3.flatMap_(tsplus_module_4.succeed(summary, __tsplusTrace), summary => tsplus_module_3.flatMap_(summary, start => tsplus_module_3.flatMap_(self, value => tsplus_module_2.map_(summary, end => tsplus_module_1.make(f(start, end), value), __tsplusTrace), __tsplusTrace), __tsplusTrace), __tsplusTrace);
}
/**
 * Summarizes a effect by computing some value before and after execution, and
 * then combining the values to produce a summary, together with the result of
 * execution.
 *
 * @tsplus static ets/Effect/Aspects summarized
 */

export const summarized = (summary, f, __tsplusTrace) => self => summarized_(self, summary, f, __tsplusTrace);
//# sourceMappingURL=summarized.mjs.map