comprehension vs `map'
Serge D. Mechveliani
mechvel at botik.ru
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?
Regards,
-----------
Mechveliani
mechvel at botik.ru
More information about the Glasgow-haskell-users
mailing list