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
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to