>Where does the infinity come from?

Here is composition signature:

(.) :: (b -> c) -> (a -> b) -> a -> c

It looks like it is applicable to functions with 1 arg. Sum expects 2 args. I guess this explains why sum can not be passed to f