.
is function composition, so what you're saying is, take the function foldr (+) 0 :: [Int] -> Int
and compose it with map (^2) a :: [Int]
, but this makes no sense, your second "function" in this composition isn't really a function.
Would you'd want instead is to swap them and use application, not composition
foldr (+) 0 (map (^2) a)
foldr (+) 0 $ map (^2) a
and this can be converted back into composition with what's called "eta conversion"
sumSquares = foldr (+) 0 . map (^2)
sumSquares = sum . map (^2)
As an aside, foldr
is probably the wrong fold here, foldl'
would be more space efficient.