[Haskell-cafe] global variables

Stefan O'Rear stefanor at cox.net
Thu May 17 09:58:16 EDT 2007


On Thu, May 17, 2007 at 02:41:33PM +0100, Eric wrote:
> Does anyone know of a simple and straightforward way to use global 
> variables in Haskell?

Just declare them at the top level, as a function but without
arguments:

=======================================================================

x = 2

main = print x

=======================================================================

Stefan


More information about the Haskell-Cafe mailing list