Simon Peyton-Jones simonpj@microsoft.com
Tue, 24 Sep 2002 09:04:26 +0100

The actions performed by unsafePerformIO are simply done at some
entirely unpredictable time, perhaps interleaved with actions on the
main execution path.=20

The formal semantics in the notes doesn't have a good way to express
that because the purely-functional part is given a denotational
semantics... yet unsafePerformIO can occur in the middle of that.

So it's tiresome to characterise in theory, and hard to predict in
practice.  You should only use it when the state it is fiddling with is
well partitioned.


| -----Original Message-----
| From: David Sabel [mailto:dsabel@stud.uni-frankfurt.de]
| Sent: 20 September 2002 13:48
| To: Simon Peyton-Jones; glasgow-haskell-users@haskell.org
| Subject: unsafePerformIO
| In read your paper ""Tackling the Awkward Squad: monadic input /
| concurrency, exceptions, and foreign-language calls in Haskell",  and
| a question about unsafePerformIO.
| In your operational semantic of the IO-Monad you tell nothing about,
| 'unsafe' IO actions are performed, is there another paper /
| about
| this available, or can you - or someone else - give me a review about
| David
| JWGU Frankfurt