Haskell Language Returning a Partially Applied Function


Returning partially applied functions is one technique to write concise code.

add :: Int -> Int -> Int
add x = (+x)

add 5 2

In this example (+x) is a partially applied function. Notice that the second parameter to the add function does not need to be specified in the function definition.

The result of calling add 5 2 is seven.