
Hello,
On 1/10/07, Ross Paterson
There is no such distinction in monadLib. The state transformer inherits its behavior from the underlying monad. For example: StateT Int IO is strict, but StatT Int Id is lazy. One way to get a strict state monad with monadLib is like this: [strict pseudo-monad]
This (like StateT) gives you strictness in the pair, but doesn't give the strictness in the state that the original poster wanted.
Once we have this kind of strictness, then the programmer has control over the state. For example, they can define: setStrict x = seq x (set x) ex3 = runLift $ runState 2 $ setStrict undefined >> return 5 ex4 = runId $ runState 2 $ setStrict undefined >> return 5 In these examples "ex3 == undefined" but "ex4 = (5,undefined)". -Iavor