
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

On Thu, Feb 19, 2009 at 09:51:06PM -0800, Arthur Chan wrote:
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)
In this situation I would combine the String and s into one state: ReaderT Int (StateT (String,s) IO) a Otherwise, yes, you'll just have to use the appropriate number of lifts. -Brent
participants (2)
-
Arthur Chan
-
Brent Yorgey