Old alternative syntax for list comprehensions?

I recently wanted to generate an infinite list of pairs [(i,j) | i <- [1..], j <- [1..]] Of course, this list comprehension never gets around to generating pairs (2,_). The solution I was after is easily done: [(i,s-i) | s <- [2..], i <- [1..s-1]] But I have a vague recollection of an alternative syntax, something like [(i,j) \ i <- [..], j <- [1..]] that generated a list something like [(1,1),(1,2),(2,1),(1,3),(2,2),(3,1),...]. Did I dream this, or was it a feature of Miranda*, Gopher or Hugs many years ago? Peter

Peter Pudney
Did I dream this, or was it a feature of Miranda*, Gopher or Hugs many years ago?
I just wanted to see that asterisk again. -- Edit this signature at http://www.digitas.harvard.edu/cgi-bin/ken/sig Let's just _force_ them to be democratic! - yet another bright American idea

But I have a vague recollection of an alternative syntax, something like
[(i,j) \ i <- [..], j <- [1..]]
that generated a list something like [(1,1),(1,2),(2,1),(1,3),(2,2),(3,1),...]. Did I dream this, or was it a feature of Miranda*, Gopher or Hugs many years ago?
Peter
A long time ago I came up with another kind of "monad" which did something like this. http://www.haskell.org/pipermail/haskell/2002-April/009327.html not that it was very useful. the distributions of the products were exponentially askew. (half of the results would be the result of combining one list with the firsts of every other lists, a quarter of the results would be the result of combining a second list with the first list and the firsts of every other list, an eighth would be...) and of course it would eat up stack for every item of the resulting list consumed. I kinda doubt this was the source of your dreams, but then again... Jay Cox
participants (4)
-
Andrew J Bromage
-
Jay Cox
-
Ken Shan
-
Peter Pudney