Re: Global Variables and IO initializers
I wrote (snipped):
3) It needs no extensions to the Haskell language, and only fairly standard hierarchical libraries like Data.IORef.
Lennart Augustsson wrote (snipped):
It uses unsafePerformIO which is very much an extension to Haskell. :)
Ben Rudiak-Gould wrote (snipped):
I think by Haskell he means the common language currently implemented by GHC and Hugs.
No. I mean by the "Haskell language" what is described in the Haskell 98 Report. unsafePerformIO is not part of the language, it is a value defined by one of the standard hierarchical libraries. However the whole point of my proposal is to hide the ugliness involved with unsafePerformIO from the user in a safe way, just as standard modules such as RandomGen do.
On 23 Nov 2004, at 11:53, George Russell wrote:
I wrote (snipped):
3) It needs no extensions to the Haskell language, and only fairly standard hierarchical libraries like Data.IORef.
Lennart Augustsson wrote (snipped):
It uses unsafePerformIO which is very much an extension to Haskell. :)
Ben Rudiak-Gould wrote (snipped):
I think by Haskell he means the common language currently implemented by GHC and Hugs.
No. I mean by the "Haskell language" what is described in the Haskell 98 Report. unsafePerformIO is not part of the language, it is a value defined by one of the standard hierarchical libraries.
But it isn't a value, is it? Since it fails referential transparency. 'unsafePerformIO' is not, in the ordinary sense a 'library routine', since library routines might ordinarily be expected to preserve haskell semantics and program equivalence etc etc. It is a genuine extension to the language (and genuinely breaks the language's semantics unless you meet the proof obligation, which is not checkable by the compiler). Jules
G'day all. Quoting George Russell <ger@informatik.uni-bremen.de>:
No. I mean by the "Haskell language" what is described in the Haskell 98 Report. unsafePerformIO is not part of the language, it is a value defined by one of the standard hierarchical libraries.
unsafePerformIO is part of the FFI addendum to the H98 report. So I think it counts as being part of "the Haskell language" by any reasonable sense of that phrase. Cheers, Andrew Bromage
ajb@spamcop.net wrote:
No. I mean by the "Haskell language" what is described in the Haskell 98 Report. unsafePerformIO is not part of the language, it is a value defined by one of the standard hierarchical libraries.
unsafePerformIO is part of the FFI addendum to the H98 report. So I think it counts as being part of "the Haskell language" by any reasonable sense of that phrase.
Well, I don't. unsafePerformIO is an extension that is very much against the spirit of Haskell. Haskell with it does not have the properties I want. So I don't use it. :) I think any addition that breaks the semantics of the language should be very clearly labelled as such. -- Lennart
On Wed, Nov 24, 2004 at 08:53:47AM +0100, Lennart Augustsson wrote:
Well, I don't. unsafePerformIO is an extension that is very much against the spirit of Haskell. Haskell with it does not have the properties I want. So I don't use it. :)
I hope 'it' means unsafePerformIO, not Haskell :) I agree. Without unsafePerformIO Haskell gives me many guarantees for free. With unsafePerformIO, they are no longer for free, I have to think, prove, etc. When I mistakenly give a pure function interface to an unpure "function", it can affect my program in most unexpected places. Best regards, Tomasz
participants (5)
-
ajb@spamcop.net -
George Russell -
Jules Bean -
Lennart Augustsson -
Tomasz Zielonka