
Nicolas Frisby
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. http://web.cecs.pdx.edu/~mpj/pubs/modinterp.html -- Edit this signature at http://www.digitas.harvard.edu/cgi-bin/ken/sig 100 Days to close Guantanamo and end torture http://100dayscampaign.org/