[Haskell-cafe] global variables

Donald Bruce Stewart dons at cse.unsw.edu.au
Thu May 17 09:45:08 EDT 2007


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

The usual way is to run the code that needs a global variable in a State monad.

The next answer is: you don't really need global variables, since you
don't have mutable variables anyway :-)

-- Don


More information about the Haskell-Cafe mailing list