
7 Mar
2007
7 Mar
'07
7:35 p.m.
On Wed, Mar 07, 2007 at 04:11:59PM -0800, Stefan O'Rear wrote:
Why can't we have:
class MonadTrans t where lift :: Monad m => m a -> t m a
Yes, we could.
metalift :: (Monad m, Monad m') => (forall a. m a -> m' a) -> t m a -> t m' b
This is a functor on the category of monads -- definitely useful.
Disclaimer: I have been able to write instances for all mtl transformers *except ContT*, and it seems plausible that ContT may force the class to be split.
You and Moggi both (Remark 4.1.11 of "An Abstract View of Programming Languages").