package base

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Set.PolySource

A polymorphic Set.

include Container.S1 with type 'elt t = ('elt, Comparator.Poly.comparator_witness) t
Sourceval length : 'a t -> int
Sourceval is_empty : 'a t -> bool
Sourceval iter : 'a t -> f:('a -> unit) -> unit
Sourceval fold : 'a t -> init:'accum -> f:('accum -> 'a -> 'accum) -> 'accum

fold t ~init ~f returns f (... f (f (f init e1) e2) e3 ...) en, where e1..en are the elements of t

Sourceval fold_result : 'a t -> init:'accum -> f:('accum -> 'a -> ('accum, 'e) Result.t) -> ('accum, 'e) Result.t

fold_result t ~init ~f is a short-circuiting version of fold that runs in the Result monad. If f returns an Error _, that value is returned without any additional invocations of f.

Sourceval exists : 'a t -> f:('a -> bool) -> bool

Returns true if and only if there exists an element for which the provided function evaluates to true. This is a short-circuiting operation.

Sourceval for_all : 'a t -> f:('a -> bool) -> bool

Returns true if and only if the provided function evaluates to true for all elements. This is a short-circuiting operation.

Sourceval count : 'a t -> f:('a -> bool) -> int

Returns the number of elements for which the provided function evaluates to true.

Sourceval sum : (module Container.Summable with type t = 'sum) -> 'a t -> f:('a -> 'sum) -> 'sum

Returns the sum of f i for all i in the container.

Sourceval find : 'a t -> f:('a -> bool) -> 'a option

Returns as an option the first element for which f evaluates to true.

Sourceval find_map : 'a t -> f:('a -> 'b option) -> 'b option

Returns the first evaluation of f that returns Some, and returns None if there is no such element.

Sourceval to_list : 'a t -> 'a list
Sourceval to_array : 'a t -> 'a array
Sourcetype 'a tree
Sourcetype comparator_witness
Sourceval invariants : _ t -> bool
Sourceval mem : 'a t -> 'a -> bool
Sourceval add : 'a t -> 'a -> 'a t
Sourceval remove : 'a t -> 'a -> 'a t
Sourceval union : 'a t -> 'a t -> 'a t
Sourceval inter : 'a t -> 'a t -> 'a t
Sourceval diff : 'a t -> 'a t -> 'a t
Sourceval symmetric_diff : 'a t -> 'a t -> ('a, 'a) Either.t Sequence.t
Sourceval compare_direct : 'a t -> 'a t -> int
Sourceval equal : 'a t -> 'a t -> bool
Sourceval is_subset : 'a t -> of_:'a t -> bool
Sourceval are_disjoint : 'a t -> 'a t -> bool
Sourcetype 'a named
Sourcemodule Named : sig ... end
Sourceval fold_until : 'a t -> init:'b -> f:('b -> 'a -> ('b, 'final) Container.Continue_or_stop.t) -> finish:('b -> 'final) -> 'final
Sourceval fold_right : 'a t -> init:'b -> f:('a -> 'b -> 'b) -> 'b
Sourceval iter2 : 'a t -> 'a t -> f:([ `Left of 'a | `Right of 'a | `Both of 'a * 'a ] -> unit) -> unit
Sourceval filter : 'a t -> f:('a -> bool) -> 'a t
Sourceval partition_tf : 'a t -> f:('a -> bool) -> 'a t * 'a t
Sourceval elements : 'a t -> 'a list
Sourceval min_elt : 'a t -> 'a option
Sourceval min_elt_exn : 'a t -> 'a
Sourceval max_elt : 'a t -> 'a option
Sourceval max_elt_exn : 'a t -> 'a
Sourceval choose : 'a t -> 'a option
Sourceval choose_exn : 'a t -> 'a
Sourceval split : 'a t -> 'a -> 'a t * 'a option * 'a t
Sourceval group_by : 'a t -> equiv:('a -> 'a -> bool) -> 'a t list
Sourceval find_exn : 'a t -> f:('a -> bool) -> 'a
Sourceval nth : 'a t -> int -> 'a option
Sourceval remove_index : 'a t -> int -> 'a t
Sourceval to_tree : 'a t -> 'a tree
Sourceval to_sequence : ?order:[ `Increasing | `Decreasing ] -> ?greater_or_equal_to:'a -> ?less_or_equal_to:'a -> 'a t -> 'a Sequence.t
Sourceval binary_search_segmented : 'a t -> segment_of:('a -> [ `Left | `Right ]) -> Binary_searchable.Which_target_by_segment.t -> 'a option
Sourceval merge_to_sequence : ?order:[ `Increasing | `Decreasing ] -> ?greater_or_equal_to:'a -> ?less_or_equal_to:'a -> 'a t -> 'a t -> ('a, 'a) Sequence.Merge_with_duplicates_element.t Sequence.t
Sourcetype ('a, 'cmp) set
Sourceval empty : 'a t
Sourceval singleton : 'a -> 'a t
Sourceval union_list : 'a t list -> 'a t
Sourceval of_list : 'a list -> 'a t
Sourceval of_sequence : 'a Sequence.t -> 'a t
Sourceval of_array : 'a array -> 'a t
Sourceval of_sorted_array : 'a array -> 'a t Or_error.t
Sourceval of_sorted_array_unchecked : 'a array -> 'a t
Sourceval of_increasing_iterator_unchecked : len:int -> f:(int -> 'a) -> 'a t
Sourceval stable_dedup_list : 'a list -> 'a list
Sourceval map : ('a, _) set -> f:('a -> 'b) -> 'b t
Sourceval filter_map : ('a, _) set -> f:('a -> 'b option) -> 'b t
Sourceval of_tree : 'a tree -> 'a t
OCaml

Innovation. Community. Security.