Re: how to get an IntSet and a FloatSet with batteries
Florent Monnier <[email protected]>
| Newsgroups | gmane.comp.lang.ocaml.beginners |
|---|---|
| Message-ID | <CAE1DttA31OTpx6bdj=p6BL26S5zqcdNi_FXH+0DH2R_4Mg7BqA@mail.gmail.com> |
2014/1/6, Francois Berenger <[email protected]>: > Hi, > > I currently use Set.Make but I guess there are already > cooked alternatives. > > Additional bonus points: how to add the functions of_list and to_list to > those sets? > > to_list should be an alias for elements > > Thanks a lot, > F. I don't know if there is an already cooked solution, so in my ignorance, if my boss would request me to produce some strongly copylefted code I would probably do something like: $ ocaml nums.cma str.cma unix.cma bigarray.cma -I +batteries batteries.cma OCaml version 4.01.0 # module IntSet = Set.Make(BatInt) ;; # module FloatSet = Set.Make(BatFloat) ;; For a ready to use IntSet maybe it exists: $ strings `ocamlc -where`/batteries/batteries.cma |grep IntSet &IntSet@ $ strings `ocamlc -where`/batteries/batteries.cma |grep IntFloat $ but I've been unable to find it in the available amount of time. -- In hope that it can help someone Florent