
8 Dec
2021
8 Dec
'21
10:29 a.m.
could I explain Haskell list comprehensions as basically just a Cartesian/cross product machine?
Another deviation from the simple explanation: the pair (2,1) never appears in an enumeration from the Haskell expression [(x,y) | x<-[1..], y<-[1..]] Although the notation is adapted from set theory, it does not necessarily reflect the meaning of its set-theory analog. A list comprehension specifies an enumeration order. In the present case that ordering is not well founded: some elements have an infinite descending chain of predecessors and thus never appear in the enumeration. Doug