List comprehensions

2003-01-30 Thread Rijk J. C. van Haaften
Hello, Recently, I came accross this expression: [ x + y | x - xs | y - ys ] As far as I can see (Haskell Report), this is not allowed by the haskell 98 standard. So I assume it to be an ex- tension. Where can I find information about this? Thanks, Rijk

Re: List comprehensions

2003-01-30 Thread Oliver Braun
* Rijk J. C. van Haaften [EMAIL PROTECTED] [2003-01-30 11:41 +0100]: Recently, I came accross this expression: [ x + y | x - xs | y - ys ] ^ Put a comma ',' here. Regards, Olli -- obraun@ -+-[ informatik.unibw-muenchen.de ]-+-[ IIS _ INF _

Re: List comprehensions

2003-01-30 Thread Rijk J. C. van Haaften
* Rijk J. C. van Haaften [EMAIL PROTECTED] [2003-01-30 11:41 +0100]: Recently, I came accross this expression: [ x + y | x - xs | y - ys ] ^ Put a comma ',' here. That's something totally different. Two examples: 1. Comma [ x + y | x - [1,2], y -

Re: List comprehensions

2003-01-30 Thread Ross Paterson
On Thu, Jan 30, 2003 at 11:41:49AM +0100, Rijk J. C. van Haaften wrote: Recently, I came accross this expression: [ x + y | x - xs | y - ys ] As far as I can see (Haskell Report), this is not allowed by the haskell 98 standard. So I assume it to be an ex- tension. Where can I find

Re: List comprehensions

2003-01-30 Thread Oliver Braun
* Rijk J. C. van Haaften [EMAIL PROTECTED] [2003-01-30 12:06 +0100]: * Rijk J. C. van Haaften [EMAIL PROTECTED] [2003-01-30 11:41 +0100]: Recently, I came accross this expression: [ x + y | x - xs | y - ys ] ^ Put a comma ',' here. That's

RE: List comprehensions

2003-01-30 Thread Jan de Wit
Hello, Recently, I came accross this expression: [ x + y | x - xs | y - ys ] As far as I can see (Haskell Report), this is not allowed by the haskell 98 standard. So I assume it to be an ex- tension. Where can I find information about this? This is a parallel list comprehension, a

Problem with backtracking monad transformer

2003-01-30 Thread Guest, Simon
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, but it doesn't rewind past a. My sample code is below. GHCI c [0,1] match_1

Re: Problem with backtracking monad transformer

2003-01-30 Thread Andrew J Bromage
G'day all. 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, but

Re: List comprehensions

2003-01-30 Thread Jon Fairbairn
On 2003-01-30 at 11:08GMT Ross Paterson wrote: On Thu, Jan 30, 2003 at 11:41:49AM +0100, Rijk J. C. van Haaften wrote: Recently, I came accross this expression: [ x + y | x - xs | y - ys ] As far as I can see (Haskell Report), this is not allowed by the haskell 98 standard. So I

``Cannot instantiate a type variable with a forall-type''

2003-01-30 Thread Jon Cast
Why does GHC place this constraint? I would expect forall to be predicative, and a type variable to range over all types, but obviously I'm missing something. Jon Cast ___ Haskell-Cafe mailing list [EMAIL PROTECTED]

Global variables?

2003-01-30 Thread Pavel G. Zhbanov
Hello, Is it even possible to make a global variable in Haskell? If yes, how? Thanks. -- Zhbanov Pavel ___ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: Global variables?

2003-01-30 Thread Glynn Clements
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