On Wed, Mar 9, 2011 at 6:21 PM, Yves Parès <limestrael@gmail.com> wrote:
Well, I want to hide the fact that I'm using ST, so if I can hide the existential type 's' it is better.

In practice if you want to actually _use_ ST you'll find you'll need to let the world escape into your type. Otherwise you won't be able to create and pass around any STRefs or arrays and use them later. The universal quantification inside of MyST's definition will keep you from holding on to them.

BTW, does someone know why the ST default implementation (the one exposed by Control.Monad.ST) is strict, whereas those of State et Writer are lazy?

Mostly because of the principle of least surprise. It makes it act more like IO.

-Edward