blame: mtl MonadReader instance for ContT

Nicolas Frisby nicolas.frisby at
Mon Dec 29 13:16:31 EST 2008

Thanks for the pointer.

I did come across that. They only call this particular lifting "not
natural," which doesn't seem much of a justification - unless they
mean natural in a more formal sense that isn't immediately obvious to

I revisited that paper upon finding the reference in your Delimited
Dynamic Binding, the examples of which finally lent some clarity to
the differences in the computational behaviors I was dealing with.

On Sat, Dec 27, 2008 at 5:14 PM, Chung-chieh Shan
<ccshan at> wrote:
> Nicolas Frisby <nicolas.frisby at> wrote in article <5ce89fb50812221019p49bdf464rc78c1cdade5099ed at> in gmane.comp.lang.haskell.libraries:
>> > instance (MonadReader r' m) => MonadReader r' (ContT r m) where
>> >     local f m = ContT $ \c -> do
>> >         r <- ask
>> >         local f (runContT m (local (const r) . c))
>> 1) I am hoping this list can recall the reason for putting this design
>> decision into the mtl. Perhaps there's a reason to prefer this
>> particular side-effect interaction.
> For what it's worth, this interaction is justified in Section 8.4 of:
> Sheng Liang, Paul Hudak, and Mark Jones. 1995.  Monad transformers and
> modular interpreters.  In POPL '95: Conference record of the annual ACM
> symposium on principles of programming languages, 333-343. New York:
> ACM Press.
> --
> Edit this signature at
> 100 Days to close Guantanamo and end torture
> _______________________________________________
> Libraries mailing list
> Libraries at

More information about the Libraries mailing list