Open
Description
I just needed the following function, which turned out a bit trickier than I had expected:
foldlWithKeyM :: (Ord k, Monad m) => (k -> b -> a -> m b) -> b -> Map k a -> m b
foldlWithKeyM f z0 m = foldrWithKey f' return m z0
where f' k x g z = f k z x >>= g
Maybe it should be included in containers
?