import * as tsplus_module_1 from "@effect/core/stm/STM/operations/map";
import * as tsplus_module_2 from "@effect/core/stm/TArray/operations/reduceSTM";
/**
 * Count the values in the array matching a transactional predicate.
 *
 * @tsplus fluent ets/TArray countSTM
 */

export function countSTM_(self, f) {
  return tsplus_module_2.reduceSTM_(self, 0, (n, a) => tsplus_module_1.map_(f(a), result => result ? n + 1 : n));
}
/**
 * Count the values in the array matching a transactional predicate.
 *
 * @tsplus static ets/TArray/Aspects countSTM
 */

export const countSTM = f => self => countSTM_(self, f);
//# sourceMappingURL=countSTM.mjs.map