
3 Jun
2008
3 Jun
'08
11:56 a.m.
Duncan Coutts wrote:
modify :: k -> Map k e -> (e, Maybe e -> Map k e)
so it's a lookup that returns the element at k and also a continuation that lets you rebuild a new map with an altered element. I guess that doesn't account for the element not existing. There's probably a generalisation that does.
isn't it just adding the necessary Maybe?: modify :: k -> Map k e -> (Maybe e, Maybe e -> Map k e) ? -Isaac