13641Map.Make update or add
- Oct 24, 2012Am 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
Am I missing something obvious?
[Non-text portions of this message have been removed]
- Next post in topic >>