
17 May
2007
17 May
'07
4:55 p.m.
Eric
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@cl.cam.ac.uk