Top Level TWI's again was Re: [Haskell] Re: Parameterized Show

Adrian Hey ahey at iee.org
Tue Nov 23 03:10:46 EST 2004


On Monday 22 Nov 2004 6:27 pm, Lennart Augustsson wrote:

> Personally, I can't believe I hear people arguing for global variables.

Oh dear, here we go again. I repeat, AFAIK nobody who wants a solution to
this problem is advocating the use of "global variables", though it's
true that the proposal under discussion would enable their creation if
folk chose to be that foolish.

For some reason it seems to have been left entirely up to me alone
to defend the case for *top level* (not global!) mutable data structures.
But I know I'm not the only one who wants a solution of some kind.
Off the top of my head I can think of many others who've expressed
the same desire at one time or another. I won't name names because
I might be misrepresenting their views, but if you think they're
all incompetent lazy Haskell programmers eager too shoot themselves
in the foot because they just don't understand monadic IO, then you
should think again. 

As for me, I strongly object to having any further consideration of
this problem or the proposed solutions being kicked into the long grass
by ill-considered "knee jerk" reactions of horror (or ridicule) concerning
"global variables".

> As for openDevice, if a device should only allow a single open I would
> assume this is part of the device driver in the operating system?
> (I know this is shifting blame.  But I think it shifts it to where it
> belongs.  In the OS there will be an "open" flag per device.)

IOW there is no possible sound solution in Haskell. I think that's
a problem for a "general purpose" programming language. What if
there is no OS or device driver? Shouldn't people reasonably expect
to be able to write their own device driver in a general purpose
programming language?

Regards
--
Adrian Hey




More information about the Haskell mailing list