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

oleg at pobox.com oleg at pobox.com
Thu May 24 03:39:07 EDT 2007


Stephen Dolan wrote:
> unsafePerformIO is possibly the most ugly feature of Haskell, yet is
> necessary to do many things which should be possible without it, such
> as reading configuration from a file at startup or creating global
> IORefs

There is a considerable debate about global mutable state even in
imperative languages. As to reading data from a configuration file --
which should be immutable for the rest of the computation -- one
solution has been proposed back in 2002:

	Pure File Reading (was: Dealing with configuration data)
	http://www.haskell.org/pipermail/haskell/2002-September/010519.html

The problem essentially is of separate compilation and dynamic linking --
both of which are far simpler now than it was in 2002, with GHC API and
hs-plugins.


More information about the Haskell-prime mailing list