I should write a function that sums elements in a list comprehension block.
Let's take these two functions just for example:
letSum :: [Int] -> [Int]
letSum xs = [result | x <- xs, y <- xs, let result = x + y, result > 10]
normalSum :: [Int] -> [Int]
normalSum xs = [x + y | x <- xs, y <- xs, x + y > 10]
Question:
- Is the second function summing x and y twice in opposite to the first one?
- If not, how does it work?