The code works fine if you change even n to even ns :
squareEvens n = [ns * ns | ns <- n, even ns]
But keep in mind that the convention is to use the plural to name a list, and the only one to name an item from this list. Therefore, replace n and ns with the idiomatic use of Haskell:
squareEvens ns = [n * n | n <- ns, even n]
source share