Exercise:
Show how the single comprehension [(x,y) | x <- [1,2,3], y <- [4,5,6]] with two generators can be re-expressed using two comprehensions with single generators.
Hint: make use of the library function _concat_.

Another hint: it can be rewritten as

concatMap (\x -> concatMap (\y -> [(x,y)]) [4,5,6]) [1,2,3]
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to