/**
* Atomically compute the greatest element in the array, if it exists.
*
* @tsplus static effect/core/stm/TArray.Aspects maxMaybe
* @tsplus pipeable effect/core/stm/TArray maxMaybe
*/
export function maxMaybe_(ord: Ord) {
return (self: TArray): STM> =>
self.reduceMaybe(
(acc, a) => (ord.gt(a, acc) ? a : acc)
)
}