Is there a reason why the lift function in ReaderT's MonadTrans
instance is implemented as:
instance MonadTrans (ReaderT r) where
lift m = ReaderT $ \_ -> m
Instead of just using the monad's return function? Could "lift m"
be implemented as "return m"?
instance (Monad m) => Monad (ReaderT r m) where
* return a = ReaderT $ \_ -> return a*
m >>= k = ReaderT $ \r -> do
a <- runReaderT m r
runReaderT (k a) r
fail msg = ReaderT $ \_ -> fail msg
Thanks,
Daryoush
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe