
28 Mar
2012
28 Mar
'12
3:58 p.m.
Good: we have mapM, and we have forM ( = flip mapM ) . Sure this is just a convenience, and indeed "forM xs $ \ x -> do ..." is quite handy, especially if "xs" is really small, and "..." is some larger expression. Bad: we have map, but we are missing: for ( = flip map ) . The function is very convenient, for the same reasons as above. I can't remember how often I typed "for = flip map" in a source file. I never put this definition in a module either, since the import statement would be longer than the definition. So, I'm all for "for" . In Data.List? In the Prelude? (Should put it right next to "map".) - J.W.