This adds MonadCont, MonadError, MonadRWS, MonadReader, MonadState, and MonadWriter instances for ComposeT. With these instances, it's now much easier to GeneralizedNewtypeDeriving your way to a a fully functional monad transformer stack:
newtype Stack m a = Stack ((ReaderT Int `ComposeT` StateT Bool `ComposeT` WriterT String) m a)
deriving ( Functor
, Applicative
, Monad
, MonadTrans
, MonadReader Int
, MonadState Bool
, MonadWriter String
)
This adds
MonadCont
,MonadError
,MonadRWS
,MonadReader
,MonadState
, andMonadWriter
instances forComposeT
. With these instances, it's now much easier toGeneralizedNewtypeDeriving
your way to a a fully functional monad transformer stack: