I think you could say that curried function is a higher-order function that returns a function as the result.
A curried function is a function with a type that looks like a -> b -> c
- and if you add parentheses (which does not change the type) a -> (b -> c)
, you can see that this is also higher-order.
However, you can write functions that are higher-order but not curried. For example, the following simple function takes some function f
and calls it twice:
let runTwice f = f(); f();
This function has a type (unit -> unit) -> unit
, so it is not curried (it just takes some input and returns unit value), but it is higher-order because the argument is a function.
Although functions like (+)
are technically higher-order (the type is int -> (int -> int)
), I do not think that they are good examples of higher-order, because you do not usually use them in the higher-order way (but it is occasionally useful). More typical examples of higher-order functions are functions like List.map
that take functions as arguments.