Skip to content

Commit

Permalink
Update destructuring for chapter 5 nested comprehension function, closes
Browse files Browse the repository at this point in the history
  • Loading branch information
evturn committed Apr 14, 2018
1 parent 5da0f8b commit 0af2c48
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion 05-list-comprehensions/05.7-exercises.hs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ perfects n = [x | x <- [1..n], sum (factors x) - x == x]
-- Show how the list comprehension [(x, y) | x <- [1, 2], y <- [3, 4]] with two generators can be
-- expressed using two comprehensions with a single generator

nestedComprehension xs ys = concat [[(x, y) | x <- xs] | y <- ys]
nestedComprehension xs ys = concat [[(x, y) | y <- ys] | x <- xs]

-- 8.
-- Redefine the function `positions` using the function `find`
Expand Down

0 comments on commit 0af2c48

Please sign in to comment.