hi,
On 12/30/06, Ross Paterson <[EMAIL PROTECTED]> wrote:
On Sat, Dec 30, 2006 at 10:31:30PM +0000, Chris Kuklewicz wrote:
> But WriterT is not lazy enough. So I put a lazier version up on the wiki:
>
> http://haskell.org/haskellwiki/New_monads/LazyWriterT
Interesting. Writer is lazy but WriterT Identity isn't. I imagine that
both lazy and strict variants would be useful. Same for State/StateT.
this is because of the pattern matching on pairs in the do notation
(in the definition of bind). in the writer monad the definition uses
let. it can be fixed by using ~ in the do notation and the extra
lazyness is useful when working with mfix. in my library i have also
experimented with various combinations of seq (on output) and ~ to
reduce the number of space leaks but i am not sure which is the best
solution yet.
-iavor
_______________________________________________
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell