Set.Makemodule S : sig ... endcmp is Ord.compare and is the comparison function that implements this set.
(replace elt t) is (remove elt t |> add elt).
module S = Set.Make (struct type t = int * string let compare = on compare fst end)
S.(empty |> add (1,"one") |> add (1,"ONE") |> to_list) = [(1, "one")]
S.(empty |> add (1,"one") |> replace (1,"ONE") |> to_list) = [(1, "ONE")](addwhen p x xs) is (add x xs) when p x = true and otherwise is xs.
(random ?size r ()) is a random set of size (size ()) (default: < 100), and each element is given by (r ()).
(to_string ?(sep=", ") f t) returns a string representation of the set t, where the string representation of each elt is given by f.