[Haskell-cafe] Re: global variables

Jón Fairbairn jon.fairbairn at cl.cam.ac.uk
Thu May 17 12:55:27 EDT 2007


Eric <eeoam at ukfsn.org> writes:

> H|i,
> 
> Does anyone know of a simple and straightforward way to use
> global variables in Haskell?

No, no-one does. Global variables are neither simple nor
straightforward. :-P

In addition to what others have said (assuming you don't
just mean providing a name for a constant¹), to avoid the
problems caused by global variables is one of the reasons
for using a functional language.


[1] as in

> e = exp 1
-- 
Jón Fairbairn                                 Jon.Fairbairn at cl.cam.ac.uk



More information about the Haskell-Cafe mailing list