[Haskell-cafe] Sub-optimal [code]
daniel.is.fischer at googlemail.com
Wed Feb 16 23:48:07 CET 2011
On Wednesday 16 February 2011 23:13:10, Max Bolingbroke wrote:
> On 16 February 2011 21:51, Andrew Coppin <andrewcoppin at btinternet.com>
> > (Now, if only there was a version that feeds an integer to the monadic
> > action as well... Still, it's not hard to implement.)
> As simple as:
> forM [1..x] mk_my_action
The problem with that is that under certain circumstances the list is
shared in nested loops, which was what caused the thread (it was mapM_ and
not forM_, but I'd be very surprised if they behaved differently with -O2).
What Andrew wants is a listless forM[_].
More information about the Haskell-Cafe