A better type signature for `forM_`

Artyom yom at artyom.me
Thu Mar 31 23:37:26 UTC 2016


For me the convenience of |for_| (without having to use |void|) 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.

​
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20160401/9ec69251/attachment.html>


More information about the Libraries mailing list