[Haskell-cafe] Linking and unsafePerformIO

David Roundy droundy at darcs.net
Tue Oct 14 12:06:58 EDT 2008


On Tue, Oct 14, 2008 at 04:39:38PM +0100, Claus Reinke wrote:
>> Where do the semantics of haskell say this? How does it interact with
>> fixing bugs (which means changing mathematical and universal constant
>> functions--since all functions are constants)?
>
> What semantics of haskell?-) But if there was one, it might not talk
> about separate compilation (it should, though), or packages. And if
> you consider cross-package inlining, separate package updates, or
> dynamic linking, etc, you might want to flag all variable constants as  
> {-# NOINLINE c #-}, and perhaps even switch of any CSE-style
> optimizations. The usual bag of tricks for unsafePerformIO constants.

But in this case you'd also have to use the same flags for any
functions you might want to edit later.  It's always the job of the
compiler and/or build system to ensure that the compile is consistent.
But claiming that it's wrong to edit your source code is downright
silly, even if it is true that the compiler could then be more
aggresive in its optimizations...

David


More information about the Haskell-Cafe mailing list