/** * Summarizes a `STM` effect by computing a provided value before and after * execution, and then combining the values to produce a summary, together * with the result of execution. * * @tsplus static effect/core/stm/STM.Aspects summarized * @tsplus pipeable effect/core/stm/STM summarized */ export function summarized( summary: STM, f: (start: B, end: B) => C ) { return (self: STM): STM => Do(($) => { const start = $(summary) const value = $(self) const end = $(summary) return [f(start, end), value] as const }) }