import * as tsplus_module_1 from "@tsplus/stdlib/collections/Chunk/map";
import * as tsplus_module_2 from "@effect/core/stm/TMap/operations/retainIf";
import * as tsplus_module_3 from "@effect/core/stm/STM/operations/map";
import { concreteTSet } from "@effect/core/stm/TSet/operations/_internal/InternalTSet";
/**
 * retains bindings matching predicate and returns the retaind entries.
 *
 * @tsplus fluent ets/TSet retainIf
 */

export function retainIf_(self, p) {
  void 0;
  return tsplus_module_3.map_(tsplus_module_2.retainIf_(self.tmap, kv => p(kv.get(0))), _ => tsplus_module_1.map_(_, kv => kv.get(0)));
}
/**
 * retains bindings matching predicate and returns the retaind entries.
 *
 * @tsplus static ets/TSet/Aspects retainIf
 */

export const retainIf = p => self => retainIf_(self, p);
//# sourceMappingURL=retainIf.mjs.map