unions' : ('a -> 'a -> bool) -> 'a list list -> 'a list
Compute union of a family of sets modulo an equivalence.
If r is an equivalence relation an l a list of lists, the call
unions' r l returns a list with one representative of each r-equivalence
class occurring in any of the members. It thus gives a union of a family of
sets with no duplicates under the equivalence r.
- FAILURE CONDITIONS
Fails only if the relation r fails.
# unions' (fun x y -> abs(x) = abs(y))
[[-1; 2; 3]; [-2; -3; -4]; [4; 5; -6]];;
val it : int list = [-1; -2; -3; 4; 5; -6]
- SEE ALSO
insert', mem', subtract', union', unions.