[Haskell-cafe] question about STM and IO

John Lato jwlato at gmail.com
Tue Feb 12 13:55:15 EST 2008

Thanks.  Both this answer and Luke's make perfect sense.

On Feb 12, 2008 12:41 PM, Stephan Friedrichs
<stephan.friedrichs at tu-bs.de> wrote:
> Hello,
> John Lato wrote:
> > I was recently looking at the STM library, and I have a question about
> > the function "unsafeIOToSTM".  Can anyone explain to me what is unsafe
> > about it, and what sort of use would be considered "safe"?
> it's unsafe to perform IO inside of a transaction as it can't be undone,
> when rolling it back. I guess, unsafeIOToSTM has been designed in order
> to allow us to inject debugging output into a transaction, but you
> really shouldn't use it to perform "real" IO (like writing files, etc.).
> HTH - Stephan
> --
> Früher hieß es ja: Ich denke, also bin ich.
> Heute weiß man: Es geht auch so.
>   - Dieter Nuhr

More information about the Haskell-Cafe mailing list