2

If I've got something that looks like this:

list1 = [(a,b,c) | a <- [0..], b <- [0..], c <- [0..]]

How would I go about updating each of the variables once instead of c infinitely growing?

Like this:

[(0,0,0), (0,0,1), (0,1,1), (1,1,1), ...]

Instead of this:

[(0,0,0), (0,0,1), (0,0,2), (0,0,3), ...]
HTNW
  • 27,182
  • 1
  • 32
  • 60
mellow
  • 23
  • 2
  • Check out [`Control.Monad.Omega`](http://hackage.haskell.org/package/control-monad-omega-0.3.1/docs/Control-Monad-Omega.html) – Cirdec May 09 '18 at 01:59
  • 1
    (I know the first few answers at the linked dupe don't meet your "multiple infinite lists" criteria. Just keep reading. I promise there's an answer that does.) – Daniel Wagner May 09 '18 at 02:02

0 Answers0