I am trying to get a function (given as a parameter a set) to return a set whose elements are all the subset formed from the main set. Ex: {1;2;3} -> { {1}, {2}, {3}, {1,2}, {1,
If you want to use the standard Set
module, you can work with sets of strings (say) and sets of sets of strings like this:
# module S = Set.Make(String);;
. . .
# module SS = Set.Make(S);;
. . .
# let s1 = S.singleton "abc";;
val s1 : S.t =
# let ss1 = SS.singleton s1;;
val ss1 : SS.t =
# List.map S.elements (SS.elements ss1);;
- : S.elt list list = [["abc"]]