Proposal: add new forms of unsafePerformIO and
unsafeInterleaveIO
Duncan Coutts
duncan.coutts at worc.ox.ac.uk
Fri Feb 22 05:46:40 EST 2008
On Thu, 2008-02-14 at 13:11 +0200, Yitzchak Gale wrote:
> Duncan Coutts wrote:
> > The additions are documented and portable to non-ghc.
>
> This sounds like a worthy addition to the library.
>
> The documentation for unsafeInlinePerformIO is a
> description of how it behaves in GHC. Can you
> describe the semantics in a compiler-independent
> way?
Actually that's pretty difficult.
So in addition to the dangers of unsafeDupablePerformIO (that the action
may be run more than once and may be executed in parallel) we have the
possibility that the action is not necessarily run as a whole and
in-order. We loose the guarantee on >>= providing ordering of effects
and not all effects are necessarily run. Only those depending on the
inputs will necessarily run.
How's that? I'm not absolutely sure that's correct. Perhaps Don and
Simon M can think about it for a moment.
Duncan
More information about the Libraries
mailing list