0

just out of curiosity is there any way using Haskell to define a list which evaluates the entire Cartesian product Int x Int and if yes what is it ? This is not homework or anything, just started Haskell recently and i am interested because i saw variants for precise lists but didn't see for the entire Cartesian product Int x Int.

  • I think this (right from related) will answer your question: https://stackoverflow.com/questions/20516402/cartesian-product-of-infinite-lists-haskell?rq=1 (additional remark: `Int` is an instance of `Bounded` and `Enum` so you get a list by `[minBound..maxBound] :: [Int]`) – Random Dev Mar 26 '15 at 18:05
  • Oh sorry i was looking for it in related but might have missed it. I apologize for that. – Todor Dimitrov Mar 26 '15 at 18:12
  • See also [universe](http://hackage.haskell.org/package/universe), which offers `universe :: [(Integer, Integer)]`. – Daniel Wagner Mar 26 '15 at 18:31

0 Answers0