
23 Jul
2011
23 Jul
'11
10:08 a.m.
Am 23.07.2011 03:40, schrieb Dennis Raddle: ...
listOutMap :: Ord k => Map k [a] -> [(k,a)] listOutMap m = concatMap (\(k,a) -> zip (repeat k) a) (M.toList m) ...
instead of "zip" and "repeat" I prefer just "map": "\ (k, as) -> map (\ a -> (k, a)) as" (and don't bother to switch on TupleSections for "(k,)") C.