[Haskell-cafe] State monad strictness - how?

Yitzchak Gale gale at sefer.org
Thu Jan 11 05:03:04 EST 2007

Iavor Diatchki wrote:
>>> The state transformer inherits its behavior from
>>> the underlying monad.

Ross Paterson wrote:
>> This (like StateT) gives you strictness in the pair, but doesn't give
>> the strictness in the state that the original poster wanted.

I think it does - if you run his program with State Int
replaced by StateT Int Identity, it now runs in constant memory.

> Once we have this kind of strictness, then the programmer
> has control over the state.

That is true for MTL as well.


More information about the Haskell-Cafe mailing list