
I agree that the change improves the consistence of semantics. You should amend the proposal to also explain how to restore the previous strictness using 'seq'. And if StateT is to be fixed, then the same fix should be applied to WriterT, as shown in http://haskell.org/haskellwiki/New_monads/LazyWriterT And the same fix looks like it should be applied to RWST. ErrorT I believe is supposed to be Strict, so it can stop when a (Left _) is found. Ian Lynagh wrote:
http://hackage.haskell.org/trac/ghc/ticket/1127
Deadline: 28 February 2007.
I propose we make StateT lazy, as I suspect was the intention all along and as has been discussed (without reaching a conclusion) before.
The patch is simply (in the definition of (>>=)):
hunk ./Control/Monad/State.hs 195 - (a, s') <- runStateT m s + ~(a, s') <- runStateT m s
Thanks Ian
_______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries