[Haskell-cafe] Re: Monad transformers

Tomasz Zielonka tomasz.zielonka at gmail.com
Sun May 8 14:29:31 EDT 2005


On Sun, May 08, 2005 at 10:19:28PM +0400, Max Vasin wrote:
> On Sun, 8 May 2005 18:34:37 +0200, Tomasz Zielonka <tomasz.zielonka at gmail.com> said:
> > On Sun, May 08, 2005 at 07:54:43PM +0400, Max Vasin wrote:
> >> f :: ReaderT env monad1 rtype g :: Reader env rtype
> 
> > How about:
> >     toReaderT :: (Monad m) => Reader r a -> ReaderT r m a 
> >     toReaderT (Reader f) = ReaderT (return . f)
> 
> Thanks. 

You can also make 'g' more generic, using the MonadReader type-class.

Best regards
Tomasz


More information about the Haskell-Cafe mailing list