[Haskell-cafe] REALLY simple STRef examples
Chad Scherrer
chad.scherrer at gmail.com
Fri Jul 21 11:06:25 EDT 2006
The IO monad hasn't given me too much trouble, but I want to be sure
to structure things the way "they should be". If I get everything
running using IO first and then have type-checking problems with ST,
it will be tempting to just slap on an unsafePerformIO and call it
good. Sure, it's really doing the same thing anyway, but it just comes
out looking like a hack.
On 7/20/06, Bulat Ziganshin <bulat.ziganshin at gmail.com> wrote:
> Hello Chad,
>
> Friday, July 21, 2006, 12:26:58 AM, you wrote:
>
> > Ok, I see now why the return is necessary.
>
> btw, it may be helpful to read "IO inside" material. ST monad is not
> very different from IO monad - it only limited to operations on STRef
> and STArray, so that it can't have side-effects visible outside of
> runST statement used to run ST computation
>
More information about the Haskell-Cafe
mailing list