sig
  type ('a, 'phantom) t
  val length : ('a, 'b) t -> int
  val is_empty : ('a, 'b) t -> bool
  val iter : ('a, 'b) t -> f:('-> unit) -> unit
  val fold :
    ('a, 'b) t -> init:'accum -> f:('accum -> '-> 'accum) -> 'accum
  val exists : ('a, 'b) t -> f:('-> bool) -> bool
  val for_all : ('a, 'b) t -> f:('-> bool) -> bool
  val count : ('a, 'b) t -> f:('-> bool) -> int
  val find : ('a, 'b) t -> f:('-> bool) -> 'a option
  val find_map : ('a, 'c) t -> f:('-> 'b option) -> 'b option
  val to_list : ('a, 'b) t -> 'a list
  val to_array : ('a, 'b) t -> 'a array
  type ('a, 'cmp) tree
  val invariants : comparator:('a, 'cmp) Comparator.t -> ('a, 'cmp) t -> bool
  val mem : comparator:('a, 'cmp) Comparator.t -> ('a, 'cmp) t -> '-> bool
  val add :
    comparator:('a, 'cmp) Comparator.t -> ('a, 'cmp) t -> '-> ('a, 'cmp) t
  val remove :
    comparator:('a, 'cmp) Comparator.t -> ('a, 'cmp) t -> '-> ('a, 'cmp) t
  val union :
    comparator:('a, 'cmp) Comparator.t ->
    ('a, 'cmp) t -> ('a, 'cmp) t -> ('a, 'cmp) t
  val inter :
    comparator:('a, 'cmp) Comparator.t ->
    ('a, 'cmp) t -> ('a, 'cmp) t -> ('a, 'cmp) t
  val diff :
    comparator:('a, 'cmp) Comparator.t ->
    ('a, 'cmp) t -> ('a, 'cmp) t -> ('a, 'cmp) t
  val compare_direct :
    comparator:('a, 'cmp) Comparator.t -> ('a, 'cmp) t -> ('a, 'cmp) t -> int
  val equal :
    comparator:('a, 'cmp) Comparator.t ->
    ('a, 'cmp) t -> ('a, 'cmp) t -> bool
  val subset :
    comparator:('a, 'cmp) Comparator.t ->
    ('a, 'cmp) t -> ('a, 'cmp) t -> bool
  val fold_until :
    ('a, 'b) t ->
    init:'accum ->
    f:('accum -> '-> [ `Continue of 'accum | `Stop of 'accum ]) -> 'accum
  val fold_right :
    ('a, 'b) t -> init:'accum -> f:('-> 'accum -> 'accum) -> 'accum
  val iter2 :
    comparator:('a, 'cmp) Comparator.t ->
    ('a, 'cmp) t ->
    ('a, 'cmp) t ->
    f:([ `Both of 'a * '| `Left of '| `Right of 'a ] -> unit) -> unit
  val filter :
    comparator:('a, 'cmp) Comparator.t ->
    ('a, 'cmp) t -> f:('-> bool) -> ('a, 'cmp) t
  val partition_tf :
    comparator:('a, 'cmp) Comparator.t ->
    ('a, 'cmp) t -> f:('-> bool) -> ('a, 'cmp) t * ('a, 'cmp) t
  val elements : ('a, 'b) t -> 'a list
  val min_elt : ('a, 'b) t -> 'a option
  val min_elt_exn : ('a, 'b) t -> 'a
  val max_elt : ('a, 'b) t -> 'a option
  val max_elt_exn : ('a, 'b) t -> 'a
  val choose : ('a, 'b) t -> 'a option
  val choose_exn : ('a, 'b) t -> 'a
  val split :
    comparator:('a, 'cmp) Comparator.t ->
    ('a, 'cmp) t -> '-> ('a, 'cmp) t * bool * ('a, 'cmp) t
  val group_by :
    comparator:('a, 'cmp) Comparator.t ->
    ('a, 'cmp) t -> equiv:('-> '-> bool) -> ('a, 'cmp) t list
  val find_exn : ('a, 'b) t -> f:('-> bool) -> 'a
  val find_index : ('a, 'b) t -> int -> 'a option
  val remove_index :
    comparator:('a, 'cmp) Comparator.t -> ('a, 'cmp) t -> int -> ('a, 'cmp) t
  val to_tree :
    ('a, 'cmp) t -> ('a, 'cmp) Core_set_intf.Accessors2_with_comparator.tree
end