Re[2]: [Haskell-cafe] question about STM and IO

2008-02-21 Thread Bulat Ziganshin
Hello Ryan, Thursday, February 21, 2008, 5:02:52 AM, you wrote: values, determine that x = y, and just return (), but it's too late, the missiles have already been launched. it seems that asymmetrical answer of mr.Putin is just to hire a bit more Haskell Hackers :) -- Best regards, Bulat

Re: [Haskell-cafe] question about STM and IO

2008-02-20 Thread Bulat Ziganshin
Hello John, Tuesday, February 12, 2008, 9:28:22 PM, you 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? STM operations can be repeated if

Re: [Haskell-cafe] question about STM and IO

2008-02-20 Thread Ryan Ingram
On 2/20/08, Bulat Ziganshin [EMAIL PROTECTED] wrote: STM operations can be repeated if first transaction was unsuccessful. so, you may se here only operations that may be safely repeated - say, reading/writing memory areas, or reading/writing files, or even sending network message as long as

Re: [Haskell-cafe] question about STM and IO

2008-02-20 Thread John Lato
I take it that this follows from the lack of any mechanism to rollback IO? If so, I think that the following guidelines suffice for when it's acceptable to use unsafeIOtoSTM: 1. The IO action must be able to be safely repeated. 2. The IO action must be able to be safely performed with

Re: [Haskell-cafe] question about STM and IO

2008-02-14 Thread Ricardo Herrmann
Stephan Friedrichs-2 wrote: 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

[Haskell-cafe] question about STM and IO

2008-02-12 Thread John Lato
Hello, 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? Thanks, John ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] question about STM and IO

2008-02-12 Thread John Lato
Thanks. Both this answer and Luke's make perfect sense. John On Feb 12, 2008 12:41 PM, Stephan Friedrichs [EMAIL PROTECTED] 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

Re: [Haskell-cafe] question about STM and IO

2008-02-12 Thread Stephan Friedrichs
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,

Re: [Haskell-cafe] question about STM and IO

2008-02-12 Thread Luke Palmer
On Feb 12, 2008 6:28 PM, John Lato [EMAIL PROTECTED] wrote: Hello, 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? A few things. First, this