Signature of Control.Monad when and unless
haskell-oren at ben-kiki.org
Fri Aug 24 11:12:55 CEST 2012
I understand why the normal signature is:
when :: Monad m => Bool -> m () -> m ()
unless :: Monad m => Bool -> m () -> m ()
But why isn't there also:
when_ :: Monad m => Bool -> m a -> m ()
unless_ :: Monad m => Bool -> m a -> m ()
That is, I agree that results shouldn't be discarded "by default", but it
should be easy to get rid of them if they are unneeded.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Libraries