Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 6eecaae1 authored by POTTIER Francois's avatar POTTIER Francois
Browse files

Added [Atom.Set.union_many].

parent 983ff33f
Branches
No related tags found
No related merge requests found
......@@ -144,6 +144,13 @@ module Set = struct
let disjoint xs ys =
is_empty (inter xs ys)
(* Iterated union. *)
let union_many (f : 'a -> t) (xs : 'a list) : t =
List.fold_left (fun accu x ->
union accu (f x)
) empty xs
(* Disjoint union. *)
exception NonDisjointUnion of atom
......
......@@ -30,6 +30,8 @@ module Set : sig
val disjoint: t -> t -> bool
val union_many: ('a -> t) -> 'a list -> t
(* Disjoint union. *)
exception NonDisjointUnion of atom
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment