The safe-freeze package

The new monad is defined in Control.Monad.ST.Freeze. An example
of its use is given in Data.Vector.Generic.Mutable.STFreeze. The
module Data.STRef.Freeze is a reexports of Data.STRef but lifted
to the new ST monad.