In Haskell, functions can be partially applied; we can think of all functions as taking a single argument, and returning a modified function for which that argument is constant. To illustrate this, we can bracket functions as follows:
(((plus) 1) 2)
Here, the function (plus)
is applied to 1
yielding the function ((plus) 1)
, which is applied to 2
, yielding the function (((plus) 1) 2)
. Because plus 1 2
is a function which takes no arguments, you can consider it a plain value; however in Haskell, there is little distinction between functions and values.
To go into more detail, the function plus
is a function that adds its arguments.
The function plus 1
is a function that adds 1
to its argument.
The function plus 1 2
is a function that adds 1
to 2
, which is always the value 3
.