David Menendez wrote:
On Wed, Oct 1, 2008 at 7:53 PM, wren ng thornton <[EMAIL PROTECTED]> wrote:
[1] Just like existential types, you can put something in but you can never
get it back out again. For inescapable monads like IO and ST, this is why
they have the behavior of sucking your whole program into the existential
black-hole.

That's true for IO, but the whole point of ST is that it *is*
escapable. What makes ST (and IO and STM) unusual is that it can't be
implemented in pure Haskell without special support from the run-time
system.

I suppose it depends on definitions. Certainly you can runST it to get an end result out, but doing so looses the internal structure (STRefs) which cannot be reclaimed. To me this makes ST a world apart from State, [], Maybe, and other monads which you can freely escape and reenter. Perhaps it would've been better to say that ST is not, er, reentrant.

--
Live well,
~wren
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to