atom feed4 messages in org.haskell.librariesProposal: Add Monad instance for Wrap...
FromSent OnAttachments
Daniel GorínAug 2, 2013 3:17 am 
Roman CheplyakaAug 2, 2013 3:27 am 
John WiegleyAug 2, 2013 2:43 pm 
Nathan van DoornAug 3, 2013 1:52 am 
Subject:Proposal: Add Monad instance for WrappedMonad
From:Daniel Gorín (dgo@dc.uba.ar)
Date:Aug 2, 2013 3:17:48 am
List:org.haskell.libraries

Control.Applicative.WrappedMonad allows one to use the Functor and Applicative
interfaces of something that is only known to be a Monad but, oddly enough, it
hides its Monad interface. The proposal is to add the missing Monad instance.

A typical use case for this instance would be:

f :: Failure String m => T1 -> m T2 f = unwrapMonad . f' where f' x = do ... -- one can also use (<$>), (<*>), etc here

(NB. the Failure class is a subclass of Monad only).

A related proposal for the transformers package would be to add a MonadTrans
instance for WrappedMonad as well.

Thanks, Daniel