Why isn't it necessary to use lift for executing a function in an internal monad transformer environment, except for IO? I mean, if I have StateT over WriterT and WriterT over ReaderT, why can I do this?
tell $ {- any code here for the Writer -}
foo <- asks {- This for the reader -}
and so on...
instead of
lift $ tell $ {- code ... -}
...
Is there an special explanation or it is only the way the Monad Transformers were written?
WriterT
has. – icktoofaytransformers
library instead ofmtl
you will have to explicitlylift
everything. – Gabriella Gonzalez