[Haskell-cafe] Current situation regarding global IORefs

Adrian Hey ahey at iee.org
Mon Apr 24 02:42:10 EDT 2006

Lennart Augustsson wrote:
> I think global mutable variables should be regarded with utmost
> suspicion.  There are very few situations where they are the
> right solution.

Well IMO even the use of the term "global mutable variable" causes
muddled thinking on this and I wish people would stop it. There's no
reason to regard top level "things with identity" (call them "TWI"s
or "objects" or whatever) with any more suspicion than top level IO
actions themselves.

One thing I never could fathom about the position of the nay-sayers
in this debate is what exactly is it that they object to?
Is it existence of top level "TWI"s and of IO operations that
reference them *in principle*?
Or are they content with their existence but just don't want to
allow people to use Haskell to define them?

If it's the former then we should be purging the IO libraries of
all such horrors, though I can't see much remaining of them (well
anything actually). But I guess an IO incapable language might
still have some niche uses.

If it's the latter then we are advocating a language which cannot
be used to implement many demonstrably useful IO modules and libraries,
*by design*. If so, the claim that Haskell is a general purpose
programming language seems quite bogus and should be removed from
the haskell.org home page IMO.

Adrian Hey

More information about the Haskell-Cafe mailing list