September 1, 2026

Haskell for Hobos -- Curry those arguments

Haskell is named after a fellow by the name of Haskell Curry. His list name is commemorated in the language as the name given to the way in which function arguments are handled.

Here is the big surprise. In Haskell, every function has only one argument. You should be rising up to call me a liar at this point. Haskell has a function named "take" that extracts the first N items in a list and spit them out in a new list.
It looks something like this:

take 5 list
Here the function "take" clearly has 2 arguments.
Currying works in the following way.

The function "take" is applied to the next argument "5" to produce an intermediate (invisible) function that in turn takes just one argument (the list). How about that? Haskell always does this.

We can actually tap into this process and grab that intermediate function. Doing so is called "partial application". Consider this:

takefive = take 5
Now we have a specific function that takes the first 5 things from a list and gives them to us in a new list.


Have any comments? Questions? Drop me a line!

Tom's software pages / tom@mmto.org