Proposal: Add isLeft/isRight to Data.Either

Evan Laforge qdunkan at gmail.com
Thu Dec 6 23:05:53 CET 2012


>>   - I often use the 'when'-like combinator 'whenJust' in monadic code:
>>
>>      whenJust :: Monad m => Maybe a -> (a -> m ()) -> m ()
>>      whenJust (Just x) a = a x
>>      whenJust _        _ = return ()
>
>
> +1. whenJust is defined also in Agda.Utils.Monad, should also added to
> Control.Monad.

Off topic, but I have whenJust in my local library too, and I use it
all the time.



More information about the Libraries mailing list