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

Achim Schneider barsoap at web.de
Fri Nov 7 04:41:01 EST 2008

Maur____cio <briqueabraque at yahoo.com> wrote:

> > 
> >> [...]
> >>
> > Are you sure you don't want to use monad transformers?
> > 
> No. Do you have a sugestion on how could I do
> it in this situation?
Not really, mainly because if monad transformers don't confuse you you
should double-check if you aren't one of these SPJ clones he spawned to
make Haskell succeed...

But then, you either want a ReaderT r State s or StateT s Reader r,
depending on how you want to write your code... the main thing that
confuses me right now is that nesting order doesn't seem to matter that
much in this case which makes me wonder if I really understood how
those two nest.

As another idea, you might want to use Parsec, you can regard it as a
Reader on steroids and it also supports state, though you'll be
conjuring up evil spirits if you try to influence parsing behaviour
with it instead of just your return values. Two or even more passes
are the way to go in such cases.

(c) this sig last receiving data processing entity. Inspect headers
for copyright history. All rights reserved. Copying, hiring, renting,
performance and/or quoting of this signature prohibited.

More information about the Haskell-Cafe mailing list