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

13641Map.Make update or add

Expand Messages
  • Jeff Massung
    Oct 24, 2012
    • 0 Attachment
      Am I blind or is a function like Haskell's Data.Map.adjust not present for
      the Ocaml Map implementation? I hate to think I have to that adding my own
      naive implementation of that function would mean O(2 log N)... once to
      search and once to add if not already found.

      I looked at Map.merge, but a cursory test shows that it traverses the
      entire map irregardless of argument ordering, which I had guessed from the
      wording of the documentation (but just wanted to be certain), so it's not
      like I can merge with a singleton map of the one element I'd like to
      add/search for.

      Am I missing something obvious?

      Jeff


      [Non-text portions of this message have been removed]
    • Show all 2 messages in this topic