We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 804994b commit 903876eCopy full SHA for 903876e
2 files changed
lib/data/set.ml
@@ -24,6 +24,9 @@ let singleton x = S (T.singleton x)
24
(** Construct a 'set' from the elements of a 'list' *)
25
let from_list (xs : list _) = S (T.from_foldable xs)
26
27
+(** Construct a 'list' from the elements of a 'set', in ascending order *)
28
+let to_list (xs : t _) = T.inorder_fold (::) [] xs
29
+
30
(** Insert an element into a 'set'. *)
31
let insert x (S tree) = S (T.insert x tree)
32
lib/prelude.ml
@@ -32,3 +32,4 @@ let print = Io.print
let flip f x y = f y x
33
let x |> f = f x
34
let f # g = fun x -> f (g x)
35
+let map f x = f <$> x
0 commit comments