For what it's worth, we made that change in mono-traversable already, although the primary motivation was performance, not safety.
https://github.com/snoyberg/mono-traversable/issues/28
http://www.yesodweb.com/blog/2014/05/foldable-mapm-maybe-recursive
_______________________________________________For me the convenience of
for_
(without having to usevoid
) is more important than increased safety, but I accept that others’ needs are different – sometimes avoiding such nasty surprises is incredibly important, sometimes not so, and it depends both on the developer and the project.
In an ideal world it’d probably be an optional warning (which I’d be able to disable, just like I do with
fwarn-unused-do-bind
), but I have no idea how hard it would be to implement and I can't imagine how it might look anyway.
Bottom line: if it will result in an error and not a warning (i.e. changing the type of
mapM_
/forM_
/for_
, as originally proposed), I’m mildly against this idea.
Libraries mailing list
Libraries@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries