[Haskell-cafe] Language support for imperative code. Was: Re: monad subexpressions

Martin Percossi haskell-cafe at martinpercossi.com
Wed Aug 8 11:30:52 EDT 2007


Brian Hulley wrote:

> hidden away in the definition of their API function to create a label, 
> is a call to (ref 0) !!!! ;-) The equivalent implementation in Haskell 
> would completely destroy all hope of using this in a pure context and 
> force all use of the API into the IO monad.

Really? I would have thought this is a job for the ST monad, in which 
case the API can be wrapped up in a runST or similar; no need for 
leaking IO monads.

Or am I missing something?

Regards,
Martin

My music: http://www.youtube.com/user/thetonegrove (please visit!)


More information about the Haskell-Cafe mailing list