Theodore Norvell <[EMAIL PROTECTED]> asks:
> Jorge's question raised a question in my mind.  The IOExts
> module has many of the same features as the ST module, why
> are there two ways to do the same thing?  Is the ST module
> only there for legacy purposes?

The ST monad provides safer encapsulation of mutable references.  We
can prove that references which escape a particular instance of ST are
never side effected.  See the paper "Lazy Functional State Threads":

  http://www.cse.ogi.edu/~jl/Papers/stateThreads.ps

This allows us to construct functions which are certain to present a
functional face to the world, but use mutation internally.  In this
respect, ST is actually "better" than IO, albeit less well-supported.

-Jan-Willem Maessen

[Note that the above paper presents the version of ST contained in the
LazyST library these days (if my memory serves me right).  The
arguments about encapsulation apply in either case.]

_______________________________________________
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to