On Fri, 30 Jul 2010, Ben wrote:

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)

Maybe:

   mapPair (M.fromAscList, M.fromAscList) $
   unzip $ map (\(a,(b,c)) -> ((a,b), (a,c))) $ M.toAscList m
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to