I\'m trying to carry out the following computation: sum of the squares of integers in the range x:y where (x <= y).
I\'m not sure how to put a constraint to ensur
Using list comprehension:
squareSum from to | from > to = error "wrong input" | otherwise = sum [i^2 | i <- [from..to]]
UPDATE: updated after OP has updated the question