On 30-May-2000, George Russell <[EMAIL PROTECTED]> wrote:
> "Ronald J. Legere" wrote:
> >
> > SUMMARY: How about a supplement to the standard that contains the
> > 'standard' extensions that everyone uses.
> One problem I have with this is that "unsafe" operations, being unsafe,
> are difficult to fit in with the rest of the language. For example
> a common use of unsafePerformIO is to set up global variables:
>
> counter :: MVar Int
> counter = unsafePerformIO(newMVar 0)
>
> What exactly does this mean? I presumably want only one counter for the
> whole program. But what is a program? Suppose "counter" is declared as
> part of a "where" clause in a bigger function. Is the compiler allowed
> to lift it so that there is only one counter, or should it create only one?
> And so on. I think the current situation, where such functions are only
> supplied as extensions with "caveat emptor" implied, is probably best.
I have to say that the current situation, where the Hugs/ghc
documentation for these features is worse than non-existent,
is certainly far from the best imaginable. The Hugs/ghc implementors
should bite the bullet and explicitly document exactly what is
guaranteed about the behaviour of these features. Likewise for the
implementors of any other Haskell implementations which support such
features.
(If nothing at all can be guaranteed, then no-one should be using those
features, and they should be removed from the Hugs/ghc extension libraries.
But it should be possible to make some guarantees.)
--
Fergus Henderson <[EMAIL PROTECTED]> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger [EMAIL PROTECTED] | -- the last words of T. S. Garp.