[Haskell-cafe] StateWriter: a monad-writing exercise

2008-09-25 Thread Anthony LODI
Hello haskell-cafe, In my application I have a complex state threaded through long computation chains, and I need a way to log all state changes (so that the evolving state can be animated/replayed somewhere else). Initially I tried combining State and Writer monads but this allows for the

Re: [Haskell-cafe] StateWriter: a monad-writing exercise

2008-09-25 Thread Henning Thielemann
On Thu, 25 Sep 2008, Anthony LODI wrote: Hello haskell-cafe, In my application I have a complex state threaded through long computation chains, and I need a way to log all state changes (so that the evolving state can be animated/replayed somewhere else). Initially I tried combining State and

Re: [Haskell-cafe] StateWriter: a monad-writing exercise

2008-09-25 Thread Anthony LODI
On Thu, Sep 25, 2008 at 10:34 AM, Henning Thielemann [EMAIL PROTECTED] wrote: Instead of rewriting from scratch, you can also define newtype StateWriter l s a = StateWriter (StateT s (Writer l) a) Thanks for the tip! I knew there must be a way to reuse some of the existing machinery. I'll