(If we ignore the Num
typeclass for a moment and pretend that + works on Integer
s only for simplicity's sake,) (+)
is a function of type Integer -> (Integer -> Integer)
(the parentheses aren't necessary because ->
is right-associative, but I've added them for clarity). That means it takes an argument of type Integer
and produces a function of type Integer -> Integer
as its result.
So when you apply (+)
to the Integer 1
, you do indeed get a function of that type as the result. Since add1
holds that result, it is thus a function of type Integer -> Integer
and that's why you can apply it as plus1 3
.