I’ve noticed what seems to be a growing inclination to confuse currying functions, with partial function application. The recently updated HaskellWiki pages (currying, partial application) are helpful in understanding the difference.

I think the reason for this confusion is that functions in Haskell are curried by default, making it rare for someone learning Haskell to need to explicitly curry a function. Explicit partial application is pervasive though, so the error is almost always using “curry” when you mean “partial application.”

Quoting HaskellWiki: “Currying is the process of transforming a function that takes multiple arguments into a function that takes just a single argument and returns another function if any arguments are still needed.”

Since Haskell functions are already curried, we simulate standard non-curried functions by using tuple arguments. A non-curried addition function would look like:

```
add :: (Int, Int) -> Int
add i = (fst i) + (snd i)
```

We can’t immediately partially apply a single argument of “1” to this, in order to get an “increment” function. Using the `curry`

function from Standard Prelude, we can transform this (poorly written) function, and immediately take advantage of partial application by giving it an argument (1):

```
increment :: Int -> Int
increment = curry add 1
```

The HaskellWiki Currying page has a couple quick puzzles at the end, which I’ve solved in a ghci transcript below:

- Simplify
`curry id`

`Prelude> :t curry curry :: ((a, b) -> c) -> a -> b -> c Prelude> :t curry id curry id :: a -> b -> (a, b) Prelude> :t (,) (,) :: a -> b -> (a, b)`

- Write the function
`\(x,y) -> (y,x)`

without lambda and with only Prelude functions`Prelude> :t \\(x,y) -> (y,x) \(x,y) -> (y,x) :: (t, t1) -> (t1, t) Prelude> :t flip flip :: (a -> b -> c) -> b -> a -> c Prelude> :t uncurry uncurry :: (a -> b -> c) -> (a, b) -> c Prelude> let switch = uncurry (flip (,)) Prelude> switch (1,2) (2,1)`