Top level mutable data structures problem

Remi Turk rturk at
Wed Oct 20 12:20:48 EDT 2004

On Wed, Oct 20, 2004 at 05:54:37PM +0200, Tomasz Zielonka wrote:
> On Wed, Oct 20, 2004 at 04:38:54PM +0100, Simon Peyton-Jones wrote:
> > b) how much happier your life would be if it were implemented
> Or... How much sadder your life will be if this mechanism will be
> abused and overused. Someone already noticed that with such and
> extension main is no longer neccessary. Imagine you have to check all
> modules (even those that are only imported, but not used) to understand
> what the program is doing. In current situation I can quickly eliminate
> some modules from consideration.

I think that if those bindings would be lazy the way they are now
(using unsafePerformIO) both risks would be lower:

- `Import' continues not to have weird side-effects.
- Complex order-dependant initialisations (more complex than newIORef's
  "must be initialized before use") cannot so easily be done.
- when one really wants to do it that way he can still use something
  like this:

	main | v1 `seq` v2 `seq` False = undefined
	     | otherwise = do

Which doesn't mean I'm in favour of that either.

Remi "waiting to be convinced" Turk

Nobody can be exactly like me. Even I have trouble doing it.

More information about the Glasgow-haskell-users mailing list