On Wed, Nov 23, 2005 at 10:47:02AM -0000, Simon Marlow wrote:
> Apologies for being a bit blunt, but can't this
> problem be solved by introducing a LazyStateT in
> addition to StateT? This follows the pattern of
> ST (default is strict, we also have
> Control.Monad.ST.Lazy).
That would be great. Except that I would prefer
StrictState, with laziness the default. ST is from
the IO family of monads, so one expects
strictness. MTL monads are usually pure, so the
default should be laziness like everywhere else in
Haskell.
Many of the programs I have written in the past
few years would break if State were to become
strict.
But in any case, there is still a bug to
fix. State and StateT are currently straddling
both sides of the fence; State is lazy, and StateT
is strict.
Regards,
Yitz