Re: [Haskell] Global Variables and IO initializers: A proposal and semantics

2004-10-13 Thread Andy Moran
Nothing to add, other than to point people at a different solution, using implicit parameters and rank-2 types: http://www.cs.chalmers.se/~rjmh/Globals.ps Admittedly, John's approach interacts in a prickly manner with the monomorphism restriction, but it does allow for the safe updating of glo

Re: [Haskell] Global Variables and IO initializers: A proposal and semantics

2004-10-13 Thread Jules Bean
On 13 Oct 2004, at 00:04, Greg Buchholz wrote: John Meacham wrote: I have put some thought, some time ago, into the 'global initializers' problem in haskell but for various reasons never wrote up my conclusions. I'm not really qualified to answer, but does anyone think that this paper might ha

Re: [Haskell] Global Variables and IO initializers: A proposal and semantics

2004-10-13 Thread John Meacham
On Wed, Oct 13, 2004 at 07:20:06AM +0100, Jules Bean wrote: > > On 12 Oct 2004, at 23:33, John Meacham wrote: > > > and via the FFI just a > > foreign import "&global_var" :: Ptr Int > > note that we do not need any foregin code, just an object which > >allocates the space in the bss for globa

Re: [Haskell] Global Variables and IO initializers: A proposal and semantics

2004-10-12 Thread Jules Bean
On 12 Oct 2004, at 23:33, John Meacham wrote: and via the FFI just a foreign import "&global_var" :: Ptr Int note that we do not need any foregin code, just an object which allocates the space in the bss for global_var, the fact we can access and work with such space from haskell, but have no

Re: [Haskell] Global Variables and IO initializers: A proposal and semantics

2004-10-12 Thread Greg Buchholz
John Meacham wrote: > > I have put some thought, some time ago, into the 'global > initializers' problem in haskell but for various reasons never wrote > up my conclusions. I'm not really qualified to answer, but does anyone think that this paper might have a solution? http://www.eecs.

[Haskell] Global Variables and IO initializers: A proposal and semantics

2004-10-12 Thread John Meacham
I have put some thought, some time ago, into the 'global initializers' problem in haskell but for various reasons never wrote up my conclusions. The issues are 1) polymorphic references allow breaking of typesafety 2) when do the initializers get evaluated 3) do we need it? I will address thes