The statethread package

The ST monad and STRefs in a portable form.
This package implements state threads as wrapper around IO and IORefs.
Your compiler must support rank-2-types, IORefs,
unsafePerformIO and unsafeInterleaveIO.
The package can be used as drop-in replacement for the st package.