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
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,
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
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
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
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
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,
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,
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