"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 agree with Lennart Augustsson that such features are best avoided
completely if reasonably possible, but for me this would not be easy.
A possible way out would be the extension of Haskell to include
those implicit variables someone recommended a while back . . .

Reply via email to