Suggestion for module system (to get rid of many uses of unsafePerformIO)

Adrian Hey ahey at
Thu May 24 02:00:32 EDT 2007

Stephen Dolan wrote:

> At the moment,
> we have the situation of modules using unsafePerformIO newIORef, which
> influences program behaviour without being referenced by main.

Not really. Even with things as they currently are, if we have at the
top level..

resultOfSomething = unsafePerformIO doSomething

.. laziness will ensure that nothing will happen unless the value
resultOfSomething is demanded (by main ultimately).

Of course, this does not imply the above hack is at all safe.

Adrian Hey

More information about the Haskell-prime mailing list