[Haskell-cafe] Re: Monad.Reader with updates

Jules Bean jules at jellybean.co.uk
Thu Nov 6 12:21:44 EST 2008

Mauricio wrote:
>  The problem is that I need 'a' or 'b' above to sometimes also change the
> environment. I think with this method I could not get that.

I no longer understand what you want.

I thought you wanted an environment which automatically changed every 

I showed you how you can do that, although it requires making explicit 
what a "step" is, which you could do with custom combinators.

Now you want any part of the action to change the environment?

In this case, use the state monad, not the reader monad. That is what 
it's for.


More information about the Haskell-Cafe mailing list