When using the pattern (-> a b), both a and b were bound to the same type! The cause was using list comprehension instead of parallel list comprehension ([(x,y) | x <- ..., y <- ...] instead of [(x,y) | x <- ... | y <- ...]), thus resulting in the list [(x1,y1), (x1,y2), (x2,y1), (x2,y2)] instead of [(x1,y1), (x2,y2)].
When using the pattern
(-> a b)
, botha
andb
were bound to the same type! The cause was using list comprehension instead of parallel list comprehension ([(x,y) | x <- ..., y <- ...]
instead of[(x,y) | x <- ... | y <- ...]
), thus resulting in the list[(x1,y1), (x1,y2), (x2,y1), (x2,y2)]
instead of[(x1,y1), (x2,y2)]
.