import * as tsplus_module_1 from "@tsplus/stdlib/data/Function";
import * as tsplus_module_2 from "@effect/core/io/Effect/operations/flatMap";
import * as tsplus_module_3 from "@effect/core/io/Effect/operations/succeed";
/**
 * Returns an effect that performs the outer effect first, followed by the
 * inner effect, yielding the value of the inner effect.
 *
 * This method can be used to "flatten" nested effects.
 *
 * @tsplus static ets/Effect/Ops flatten
 */

export function flatten(effect, __tsplusTrace) {
  return tsplus_module_2.flatMap_(tsplus_module_3.succeed(effect, __tsplusTrace), _ => tsplus_module_2.flatMap_(_, tsplus_module_1.identity, __tsplusTrace), __tsplusTrace);
}
/**
 * Returns an effect that performs the outer effect first, followed by the
 * inner effect, yielding the value of the inner effect.
 *
 * This method can be used to "flatten" nested effects.
 *
 * @tsplus fluent ets/Effect flatten
 */

export function flattenNow(self, __tsplusTrace) {
  return tsplus_module_2.flatMap_(self, tsplus_module_1.identity, __tsplusTrace);
}
//# sourceMappingURL=flatten.mjs.map