Loading ...
Sorry, an error occurred while loading the content.

13993Re: "ocaml_beginners"::[] how to get an IntSet and a FloatSet with batteries

Expand Messages
  • Florent Monnier
    Jan 6, 2014
    • 0 Attachment
      2014/1/6, Francois Berenger <berenger@...>:
      > 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
    • Show all 7 messages in this topic