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
>> > >
* 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 ()
> >
>
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
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
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
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