import * as tsplus_module_1 from "@tsplus/stdlib/prelude/Ord/operations";
import * as tsplus_module_2 from "@effect/core/stm/TArray/operations/reduceMaybe";
/**
 * Atomically compute the least element in the array, if it exists.
 *
 * @tsplus fluent ets/TArray minMaybe
 */

export function minMaybe_(self, ord) {
  return tsplus_module_2.reduceMaybe_(self, (acc, a) => tsplus_module_1.lt(ord)(a, acc) ? a : acc);
}
/**
 * Atomically compute the least element in the array, if it exists.
 *
 * @tsplus static ets/TArray/Aspects minMaybe
 */

export const minMaybe = ord => self => minMaybe_(self, ord);
//# sourceMappingURL=minMaybe.mjs.map