comprehension vs `map'

Serge D. Mechveliani mechvel at
Fri May 15 04:00:20 EDT 2009

Dear GHC team,

I would like to write 
             [rl {ruleMode = AlwaysApply} | rl <- rules calc]        (I)

instead of   map (\ rl -> rl {ruleMode = AlwaysApply}) $ rules calc  (II)
and instead of
  let rs = rules calc in  [rl {ruleMode = AlwaysApply} | rl <- rs]  (III).

But is this reliable in GHC that the compiler converts (I) into something 
which is not not worse than III ?
What about other implementations?


mechvel at

More information about the Glasgow-haskell-users mailing list