Hello,
> Btw. the mapM memory leak can be easily and accidentally resurrected byI don't understand the whole mapM analogy (yet). I don't need when_ to
> writing
>
> when_ b (mapM f xs)
>
> with
>
> f :: a -> m ()
> when_ :: Bool -> m a -> m ()
get into trouble with using mapM. Also, whether a space leak with mapM
arises or not typically doesn't depend on whether you use its result
or not. It's the other way round: if you run mapM on a huge list but
aren't interested in the results, then you should use mapM_ instead.
So the problem here is accidentally producing a (large) result rather
than accidentally ignoring it.
Cheers,
Andres
--
Andres Löh, Haskell Consultant
Well-Typed LLP, http://www.well-typed.com
_______________________________________________
Libraries mailing list
Libraries@haskell.org
http://www.haskell.org/mailman/listinfo/libraries