Proposal: add Control.Monad.whenJust ∷ (Monad m) ⇒ Maybe α→(α→ m ()) → m ()

Mikhail Vorozhtsov mikhail.vorozhtsov at
Thu Dec 1 07:19:53 CET 2011

On 11/30/2011 11:51 PM, Liyang HU wrote:
> Also, if we go down the route of whenJust, why not whenLeft and whenRight (and so on) too?

I'd rather add something like

maybeLeft ∷ Either a b → Maybe a
maybeLeft = either Just (const Nothing)

to Data.Either

More information about the Libraries mailing list