
John Wiegley wrote:
Erik de Castro Lopo
writes: As pointed out to me on IRC (thanks pjdeport), chaning the type signature of `forM_` to forM_' :: (Monad m, Foldable t) => t a -> (a -> m ()) -> m () would have resulted in an error.
What about mapM_, replicateM_, etc.? In each case, '_' means "if you return a value from your action, it is ignored", and not "you must return unit".
Which is the exact problem. I suspect that most people use `forM_` as "assume the action returns unit" rather than "assume the return value of the action is ignored". FWIW, ignoring a list of unit is perfectly fine, but ignoring a list of `IO ()` is almost certainly not what people meant. Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/