[Haskell-cafe] StateT and ContT
Ivan Lazar Miljenovic
ivan.miljenovic at gmail.com
Sun Jan 18 10:56:31 UTC 2015
In the transformers library, there are two implementations for callCC
for use with StateT (both lazy and strict) [1,2], the second of which
is documented to not satisfy the laws of a monad transformer.
[1]: http://hackage.haskell.org/package/transformers-0.4.2.0/docs/Control-Monad-Trans-State-Lazy.html#v:liftCallCC
[2]: http://hackage.haskell.org/package/transformers-0.4.2.0/docs/Control-Monad-Trans-State-Lazy.html#v:liftCallCC-39-
However, in mtl the MonadCont class [3] uses the second definition for
the StateT instance. Is there a good reason for this, or just to
match the behaviour of pre-transformers mtl [4] ?
[3]: http://hackage.haskell.org/package/mtl-2.2.1/docs/Control-Monad-Cont-Class.html
[4]: http://hackage.haskell.org/package/mtl-1.1.1.1/docs/src/Control-Monad-State-Lazy.html
(I did raise an issue for this on mtl's Github issue tracker, but it
hasn't had any responses for two months.)
--
Ivan Lazar Miljenovic
Ivan.Miljenovic at gmail.com
http://IvanMiljenovic.wordpress.com
More information about the Haskell-Cafe
mailing list