
30 Jul
2010
30 Jul
'10
11:13 p.m.
dear traversable geniuses -- i am looking for "better" implementations of unzipMap :: M.Map a (b, c) -> (M.Map a b, M.Map a c) unzipMap m = (M.map fst m, M.map snd m) 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 the first is obviously inefficient as it traverses the map twice. the second just seems like it is some kind of fmap. any ideas? ben