[Haskell-beginners] Getting into nested monad transformers

Arthur Chan baguasquirrel at gmail.com
Fri Feb 20 00:51:06 EST 2009


Hey all,

I've been trying to access the inner state "s" for this type:

newtype TestThingey s a = TestThingey {
      runTrans :: ReaderT Int (StateT String (StateT s IO)) a
} deriving (Monad, MonadIO, MonadState String, MonadReader Int)

It doesn't seem to be doable.  I could make it into a regular type
declaration, but then I lose the GeneralizedNewtypeDeriving.  Is this
common?  Or do people just avoid needing to use "lift"?

-Arthur
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/beginners/attachments/20090219/fae704c3/attachment-0001.htm


More information about the Beginners mailing list