import * as tsplus_module_1 from "@tsplus/stdlib/data/Either/merge";
import * as tsplus_module_2 from "@effect/core/io/Schedule/operations/choose";
import * as tsplus_module_3 from "@effect/core/io/Schedule/operations/map";
/**
 * Returns a new schedule that chooses between two schedules with a common
 * output.
 *
 * @tsplus operator ets/Schedule ||
 * @tsplus operator ets/Schedule/WithState ||
 * @tsplus fluent ets/Schedule chooseMerge
 * @tsplus fluent ets/Schedule/WithState chooseMerge
 */

export function chooseMerge_(self, that) {
  return tsplus_module_3.map_(tsplus_module_2.choose_(self, that), either => tsplus_module_1.merge(either));
}
/**
 * Returns a new schedule that chooses between two schedules with a common
 * output.
 *
 * @tsplus static ets/Schedule/Aspects chooseMerge
 */

export const chooseMerge = that => self => chooseMerge_(self, that);
//# sourceMappingURL=chooseMerge.mjs.map