[Haskell-cafe] Comtrol.Monad.when

Juan Carlos Arevalo Baeza jcab.lists at JCABs-Rumblings.com
Sat Aug 27 16:11:57 EDT 2005


   Any reason why "Control.Monad.when :: Monad 
<Control.Monad.html#t%3AMonad> m => Bool <Data.Bool.html#t%3ABool> -> m 
() -> m ()" doesn't have type "Monad <Control.Monad.html#t%3AMonad> m => 
Bool <Data.Bool.html#t%3ABool> -> m a -> m ()" instead?

   Just seems a bit of a waste to have the restriction without need. I 
find myself needing to add the extra spurious "return ()" at the end 
more often than not. I made an alternate "when_" for my own use, but...

JCAB


More information about the Haskell-Cafe mailing list