
30 Jul
2010
30 Jul
'10
11:21 p.m.
On Fri, Jul 30, 2010 at 08:13:43PM -0700, Ben wrote:
unliftMap :: (Ord a) => M.Map a (b -> c) -> M.Map a b -> M.Map a c unliftMap mf ma = M.mapWithKey (\k v -> mf M.! k $ v) ma
I always thought a useful map primitive would be unionWithJoin :: (a -> b -> c) -- combine values that appear in both maps -> (b -> c) -- value appears in second map but not the first -> (a -> c) -- value appears in first map but not second -> Map k a -> Map k b -> Map k c along with the 'WithKey' and 'Maybe' variants. John -- John Meacham - ⑆repetae.net⑆john⑈ - http://notanumber.net/