
On Jul 22, 2011, at 10:58 PM, Ertugrul Soeylemez wrote:
fromAmbList :: Ord k => [(k, a)] -> Map k [a] fromAmbList = M.fromListWith (++) . map (second pure)
If I am reading your code, I may look up second and find it in Control.Arrow. I have to learn about Arrows to understand your code? And pure makes me need to study the Applicative class. I imagine that it is likely that second is the only thing from Control.Arrow that you are using and pure is the only thing from Control.Applicative. So, you need two lines of extra code to express what could be expressed much more perspicuously as:
fromAmbList :: Ord k => [(k, a)] -> Map k [a] fromAmbList = M.fromListWith (++) . map (\(k,v) -> (k,[v]))
____________________ David Place Owner, Panpipes Ho! LLC http://panpipesho.com d@vidplace.com