[Haskell-cafe] What unsafeInterleaveIO is unsafe

Ketil Malde ketil at malde.org
Thu Mar 19 03:20:34 EDT 2009


Jonathan Cast <jonathanccast at fastmail.fm> writes:

>> Couldn't you just substitute "catch exceptions" with "unsafePerformIO"
>> here, and make the same argument?

> This puzzled me, until I realized you meant `unsafeInterleaveIO'.

Aargh, yes of course!  Sorry about that.

> Assuming you mean unsafeInterleaveIO, not quite.  GHC's scheduler is
> fair, so you are guaranteed after
>
>     forkIO $ a
>
> that a's side effects will happen eventually.  

Ah, I hadn't thought of that.

-k
-- 
If I haven't seen further, it is by standing in the footprints of giants


More information about the Haskell-Cafe mailing list