[Haskell] Types of when and unless in Control.Monad

malcolm.wallace malcolm.wallace at me.com
Wed Jun 6 10:56:46 CEST 2012


On Jun 06, 2012, at 08:44 AM, Andreas Abel <andreas.abel at ifi.lmu.de> wrote:

> Well, but nothing in the type system prevents you from writing
>
> mapM f xs >> cont
>
> or
>
> do mapM f xs
>      cont
>
> so you are not warned of a space leak in the common situations anyway, 
 

At least the second form will trigger a warning in GHC (although admittedly not from the type system, but from -fwarn-unused-do-bind).  It is a jolly useful warning at times.

Regards,
    Malcolm
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20120606/02c2b01d/attachment.htm>


More information about the Libraries mailing list