At 2001-11-29 05:31, Juan Ignacio García García 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
anyway.

Lifted monads look something like this:

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

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

<http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/~checkout~/jvm-bridge/sourc
e/Haskell/IOLiftedMonad.hs?rev=HEAD&content-type=text/plain>

--
Ashley Yakeley, Seattle WA


_______________________________________________
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell

Reply via email to