Global variables

Ashley Yakeley
Thu, 29 Nov 2001 11:13:04 -0800

At 2001-11-29 05:31, Juan Ignacio Garc=EDa Garc=EDa wrote:

>I am interested in using global variables (in GHC). 

In JVM-Bridge (nearly there!) I use lifted monads to store global 
constants, though variables are not hard either. This does mean an extra 
function needed to call IO functions, but in my case you'd be calling 
mostly my glue functions to Java code, which are in the lifted monad 

Lifted monads look something like this:

     data MyAction a =3D MkMyAction ((consts,vars) -> (vars,a));
     instance Monad MyAction where etc.

I actually have a class for monads that lift the IO monad:


Ashley Yakeley, Seattle WA