[Haskell-cafe] global variables

Adrian Hey ahey at iee.org
Thu May 24 15:58:51 EDT 2007


David House wrote:
> On 24/05/07, Adrian Hey <ahey at iee.org> wrote:
>> Or even at compile time (which is why I think it's reasonable to
>> regard operations like newIORef etc.. as not really being "IO"
>> operations at all).
> 
> You can allocate heap space at compile time? (Well, I guess you could,
> but that wouldn't still be usable at run time...) I imagine newIORef
> as mallocing() some room, then returning a pointer to that memory.
> That doesn't seem like something that could be done at compile time.

There seems to be quite a few implicit (and incorrect) assumptions in
your argument, which is fallacious IMO. The logic of your argument
would imply that *no* top level expression can be evaluated at compile
time. This might be the case with ghc, though I doubt it (and even if
it was this would just be a ghc problem).

BTW, the Haskell standard says nothing about any kind of heap, let
alone a C style malloc.

Regards
--
Adrian Hey






More information about the Haskell-prime mailing list