[Haskell-cafe] Logging pure code

Marco Túlio Gontijo e Silva marcotmarcot at gmail.com
Sun Jul 29 21:45:56 CEST 2012

Hi Joey.

Thanks for your answer.

On Sun, Jul 29, 2012 at 3:16 PM, Joey Adams <joeyadams3.14159 at gmail.com> wrote:
> On Fri, Jul 27, 2012 at 9:52 AM, Marco Túlio Gontijo e Silva
> <marcotmarcot at gmail.com> wrote:
>> I thought that the only thing I needed to take care while using
>> unsafePerformIO was knowing that the time of execution is undetermined
>> and that it could even run more than once.  This is not a problem for
>> my logging.  Is there something else I should be aware while using
>> unsafePerformIO?
> Another thing to be aware of is that unsafePerformIO and STM don't
> interact well.  In particular, STM will abort doomed transactions.  If
> the transaction is IO that has exception handlers set up, those
> handlers won't be run.  This is the case for unsafeIOToSTM, but I'm
> not sure if it's the case for unsafePerformIO as well.
> Are you using STM in your program?  Also, what version of GHC are you using?

No, not in my program.  Maybe a library that I use uses it, but not
that I'm aware of.  I'm using GHC version 7.4.1, I'll try it with
7.4.2 later.


More information about the Haskell-Cafe mailing list