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

2012-04-22 Thread Ivan Lazar Miljenovic
On 22 April 2012 21:39, Christian Höner zu Siederdissen wrote: > * Julian Gilbey [22.04.2012 09:22]: >> On Sat, Apr 21, 2012 at 08:28:27PM -0500, Strake wrote: >> > On 21/04/2012, Andreas Abel wrote: >> > > to avoid silly "return ()" statements like in >> > > >> > >    when cond $ do >> > >    

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

2012-04-22 Thread Christian Höner zu Siederdissen
* Julian Gilbey [22.04.2012 09:22]: > On Sat, Apr 21, 2012 at 08:28:27PM -0500, Strake wrote: > > On 21/04/2012, Andreas Abel wrote: > > > to avoid silly "return ()" statements like in > > > > > >when cond $ do > > > monadicComputationWhoseResultIWantToDiscard > > > return () > > >

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

2012-04-22 Thread Julian Gilbey
On Sat, Apr 21, 2012 at 08:28:27PM -0500, Strake wrote: > On 21/04/2012, Andreas Abel wrote: > > to avoid silly "return ()" statements like in > > > >when cond $ do > > monadicComputationWhoseResultIWantToDiscard > > return () > > (when cond ∘ void) monadicComputationWhoseResultIWan

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

2012-04-21 Thread Strake
On 21/04/2012, Andreas Abel wrote: > to avoid silly "return ()" statements like in > >when cond $ do > monadicComputationWhoseResultIWantToDiscard > return () (when cond ∘ void) monadicComputationWhoseResultIWantToDiscard or when cond $ () <$ monadicComputationWhoseResultIWantToDisc

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

2012-04-21 Thread John Meacham
Yes, this has always bothered me too. John On Sat, Apr 21, 2012 at 2:51 AM, Andreas Abel wrote: > In Control.Monad, when has type > >  when :: Monad m => Bool -> m () -> m () > > I think this type should be generalized to > >  when :: Monad m => Bool -> m a -> m () > > to avoid silly "return

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

2012-04-21 Thread Andreas Abel
In Control.Monad, when has type when :: Monad m => Bool -> m () -> m () I think this type should be generalized to when :: Monad m => Bool -> m a -> m () to avoid silly "return ()" statements like in when cond $ do monadicComputationWhoseResultIWantToDiscard return () Cheers, A