Re: Global variables?

2003-01-31 Thread Ralf Hinze
Pavel G. Zhbanov wrote: Is it even possible to make a global variable in Haskell? If yes, how? The usual fudge is: import IORef import IOExts globalVar :: IORef Int globalVar = unsafePerformIO $ newIORef 0 However, beware of creating more than one global

RE: Problem with backtracking monad transformer

2003-01-31 Thread Guest, Simon
Hi, On Thu, Jan 30, 2003 at 01:55:50PM -, Guest, Simon wrote: I'm trying to make a backtracking state monad using Ralf Hinze's backtracking monad transformer. My problem is that it won't backtrack very far. Suppose I try ( a b ) `mplus` c. If b fails, it should try c,

Re: Global variables?

2003-01-31 Thread Jorge Adriano
Hello, Is it even possible to make a global variable in Haskell? If yes, how? Thanks. (short answer, no time now...) Look here: http://www.haskell.org/pipermail/haskell-cafe/2002-January/002589.html Hope it helps ;) J.A. ___ Haskell-Cafe mailing

Nine open CSE positions at Chalmers

2003-01-31 Thread Patrik Jansson
The School of Computer Science and Engineering (at Chalmers Univ. in Gotheburg, Sweden) announces 9 open positions (teaching+research): http://www.cse.chalmers.se/doit/doiteng/vacancies/positions.html Apply or spread the word! (List relevance: Many of us use Haskell both in teaching and in

Now solved [was RE: Problem with backtracking monad transformer]

2003-01-31 Thread Guest, Simon
Andrew Bromage wrote: You may have meant to stack the monad transformers in a different order. I finally understand. This was exactly my problem. I had to discard my state monad, and use a state monad transformer on the simple backtracking monad (not the backtracking monad transformer on

Re: Global variables?

2003-01-31 Thread Nick Name
On Fri, 31 Jan 2003 07:47:43 + Glynn Clements [EMAIL PROTECTED] wrote: The usual fudge is: import IORef import IOExts globalVar :: IORef Int globalVar = unsafePerformIO $ newIORef 0 I see in the documentation of unsafePerformIO that no one makes

Re: Global variables?

2003-01-31 Thread Jon Cast
Glynn Clements [EMAIL PROTECTED] wrote: Pavel G. Zhbanov wrote: Is it even possible to make a global variable in Haskell? If yes, how? The usual fudge is: import IORef import IOExts globalVar :: IORef Int globalVar = unsafePerformIO $ newIORef 0 However,

Re: Global variables?

2003-01-31 Thread Jon Cast
Ralf Hinze [EMAIL PROTECTED] wrote: Pavel G. Zhbanov wrote: Is it even possible to make a global variable in Haskell? If yes, how? The usual fudge is: import IORef import IOExts globalVar :: IORef Int globalVar = unsafePerformIO $ newIORef 0 However,

Re: Global variables?

2003-01-31 Thread Jon Cast
Nick Name [EMAIL PROTECTED] wrote: On Fri, 31 Jan 2003 07:47:43 + Glynn Clements [EMAIL PROTECTED] wrote: The usual fudge is: import IORef import IOExts globalVar :: IORef Int globalVar = unsafePerformIO $ newIORef 0 I see in the documentation of