import "../../../Operator"
import type { Equal } from "../../../Equal"
import type { Predicate, Refinement } from "../../../Function"
import type { Ord } from "../../../Ord"
import * as St from "../../../Structural"
import type { Separated } from "../../../Utils"
import * as RB from "../RedBlackTree"
export declare class SortedSet<V> implements Iterable<V> {
  readonly keyTree: RB.RedBlackTree<V, any>
  constructor(keyTree: RB.RedBlackTree<V, any>)
  [Symbol.iterator](): Iterator<V>
  get [St.hashSym](): number
  [St.equalsSym](that: unknown): boolean
}
export declare function make<V>(K: Ord<V>): SortedSet<V>
export declare function add_<V>(set: SortedSet<V>, v: V): SortedSet<V>
export declare function add<V>(v: V): (set: SortedSet<V>) => SortedSet<V>
export declare function remove_<V>(set: SortedSet<V>, v: V): SortedSet<V>
export declare function remove<V>(v: V): (set: SortedSet<V>) => SortedSet<V>
export declare function values<V>(set: SortedSet<V>): IterableIterator<V>
export declare function has_<V>(set: SortedSet<V>, v: V): boolean
/**
 * Apply f to each element
 */
export declare function forEach_<V>(map: SortedSet<V>, f: (v: V) => void): void
/**
 * The set of elements which are in both the first and second set,
 *
 * the hash and equal of the 2 sets has to be the same
 */
export declare function intersection_<A>(l: SortedSet<A>, r: Iterable<A>): SortedSet<A>
/**
 * The set of elements which are in both the first and second set
 *
 * @dataFirst intersection_
 */
export declare function intersection<A>(
  r: Iterable<A>
): (l: SortedSet<A>) => SortedSet<A>
/**
 * Projects a Set through a function
 */
export declare function map_<B>(
  E: Ord<B>
): <A>(set: SortedSet<A>, f: (x: A) => B) => SortedSet<B>
/**
 * Projects a Set through a function
 *
 * @dataFirst map_
 */
export declare function map<B>(
  E: Ord<B>
): <A>(f: (x: A) => B) => (set: SortedSet<A>) => SortedSet<B>
/**
 * true if one or more elements match predicate
 *
 * @dataFirst some_
 */
export declare function some<A>(predicate: Predicate<A>): (set: SortedSet<A>) => boolean
/**
 * true if one or more elements match predicate
 */
export declare function some_<A>(set: SortedSet<A>, predicate: Predicate<A>): boolean
/**
 * Calculate the number of keys pairs in a set
 */
export declare function size<A>(set: SortedSet<A>): number
/**
 * Creates an equal for a set
 */
export declare function equal<A>(): Equal<SortedSet<A>>
/**
 * true if all elements match predicate
 *
 * @dataFirst every_
 */
export declare function every<A>(
  predicate: Predicate<A>
): (set: SortedSet<A>) => boolean
/**
 * true if all elements match predicate
 */
export declare function every_<A>(set: SortedSet<A>, predicate: Predicate<A>): boolean
/**
 * Map + Flatten
 *
 * @dataFirst chain_
 */
export declare function chain<B>(
  E: Ord<B>
): <A>(f: (x: A) => Iterable<B>) => (set: SortedSet<A>) => SortedSet<B>
/**
 * Map + Flatten
 */
export declare function chain_<B>(
  E: Ord<B>
): <A>(set: SortedSet<A>, f: (x: A) => Iterable<B>) => SortedSet<B>
/**
 * `true` if and only if every element in the first set is an element of the second set,
 *
 * the hash and equal of the 2 sets has to be the same
 *
 * @dataFirst isSubset_
 */
export declare function isSubset<A>(y: SortedSet<A>): (x: SortedSet<A>) => boolean
/**
 * `true` if and only if every element in the first set is an element of the second set,
 *
 * the hash and equal of the 2 sets has to be the same
 */
export declare function isSubset_<A>(x: SortedSet<A>, y: SortedSet<A>): boolean
/**
 * Filter set values using predicate
 *
 * @dataFirst filter_
 */
export declare function filter<A, B extends A>(
  refinement: Refinement<A, B>
): (set: SortedSet<A>) => SortedSet<B>
export declare function filter<A>(
  predicate: Predicate<A>
): (set: SortedSet<A>) => SortedSet<A>
/**
 * Filter set values using predicate
 */
export declare function filter_<A, B extends A>(
  set: SortedSet<A>,
  refinement: Refinement<A, B>
): SortedSet<B>
export declare function filter_<A>(
  set: SortedSet<A>,
  predicate: Predicate<A>
): SortedSet<A>
/**
 * Partition set values using predicate
 *
 * @dataFirst partition_
 */
export declare function partition<A, B extends A>(
  refinement: Refinement<A, B>
): (set: SortedSet<A>) => Separated<SortedSet<A>, SortedSet<B>>
export declare function partition<A>(
  predicate: Predicate<A>
): (set: SortedSet<A>) => Separated<SortedSet<A>, SortedSet<A>>
/**
 * Partition set values using predicate
 */
export declare function partition_<A, B extends A>(
  set: SortedSet<A>,
  refinement: Refinement<A, B>
): Separated<SortedSet<A>, SortedSet<B>>
export declare function partition_<A>(
  set: SortedSet<A>,
  predicate: Predicate<A>
): Separated<SortedSet<A>, SortedSet<A>>
/**
 * Form the set difference (`x` - `y`)
 */
export declare function difference_<A>(x: SortedSet<A>, y: Iterable<A>): SortedSet<A>
/**
 * Form the set difference (`x` - `y`)
 *
 * @dataFirst difference_
 */
export declare function difference<A>(y: Iterable<A>): (x: SortedSet<A>) => SortedSet<A>
/**
 * Reduce a state over the map entries
 */
export declare function reduce_<V, Z>(set: SortedSet<V>, z: Z, f: (z: Z, v: V) => Z): Z
/**
 * Reduce a state over the map entries
 *
 * @dataFirst reduce_
 */
export declare function reduce<V, Z>(
  z: Z,
  f: (z: Z, v: V) => Z
): (set: SortedSet<V>) => Z
/**
 * If element is present remove it, if not add it
 *
 * @dataFirst toggle_
 */
export declare function toggle<A>(a: A): (set: SortedSet<A>) => SortedSet<A>
/**
 * If element is present remove it, if not add it
 */
export declare function toggle_<A>(set: SortedSet<A>, a: A): SortedSet<A>
/**
 * Form the union of two sets,
 *
 * the hash and equal of the 2 sets has to be the same
 */
export declare function union_<A>(l: SortedSet<A>, r: Iterable<A>): SortedSet<A>
/**
 * Form the union of two sets,
 *
 * the hash and equal of the 2 sets has to be the same
 *
 * @dataFirst union_
 */
export declare function union<A>(y: Iterable<A>): (x: SortedSet<A>) => SortedSet<A>
//# sourceMappingURL=index.d.ts.map
