I don't know if it comes up in practice, but for lazy maps we can have functions like
insertWith :: Ord k => (a -> a -> Solo a) -> k -> a -> Map k a -> Map k a
unionWith :: Ord k => (a -> a -> Solo a) -> Map k a -> Map k a -> Map k a
...
This gives the caller precise control over which thunk to put in the map.
Right now, with (a -> a -> a) versions, it's always going to be the function application (unless the map operation inlines and simplifies).
I'm not planning to add these right away, but if someone wants them it makes a lot of sense to add them.
I don't know if it comes up in practice, but for lazy maps we can have functions like
This gives the caller precise control over which thunk to put in the map.
Right now, with
(a -> a -> a)versions, it's always going to be the function application (unless the map operation inlines and simplifies).I'm not planning to add these right away, but if someone wants them it makes a lot of sense to add them.