Theodore Norvell <theo@cs.ubc.ca> 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.]
On Friday 11 January 2002 19:39, Jan-Willem Maessen wrote:
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.
So would writing for instance a GUI library, with abstract interfaces using ST be a good idea? Thanks, -- Eray Ozkural (exa) <erayo@cs.bilkent.edu.tr> Comp. Sci. Dept., Bilkent University, Ankara www: http://www.cs.bilkent.edu.tr/~erayo GPG public key fingerprint: 360C 852F 88B0 A745 F31B EA0F 7C07 AE16 874D 539C
participants (2)
-
Eray Ozkural (exa) -
Jan-Willem Maessen