Skip to content
This repository was archived by the owner on Oct 18, 2021. It is now read-only.

Commit b3755ce

Browse files
author
Abigail Magalhães
committed
UGhghrhrh
1 parent 804994b commit b3755ce

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

lib/data/set.ml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ let singleton x = S (T.singleton x)
2424
(** Construct a 'set' from the elements of a 'list' *)
2525
let from_list (xs : list _) = S (T.from_foldable xs)
2626

27+
(** Construct a 'list' from the elements of a 'set', in ascending order *)
28+
let to_list (S xs) = T.inorder_fold (::) [] xs
29+
2730
(** Insert an element into a 'set'. *)
2831
let insert x (S tree) = S (T.insert x tree)
2932

lib/prelude.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,4 @@ let print = Io.print
3232
let flip f x y = f y x
3333
let x |> f = f x
3434
let f # g = fun x -> f (g x)
35+
let map f x = f <$> x

0 commit comments

Comments
 (0)