Take the 2-minute tour ×

Suppose that the Haskell or lambda calculus presents the following function types:

A -> B -> C

(A -> B) -> C

How are these two different?

share|improve this question
The first is equivalent to A -> (B -> C). Was that your question? –  n.m. Feb 25 '13 at 4:43

2 Answers 2

The first is a function from A to a (a function from B to C). The second is a function from (functions from A to B) to C. The first "takes two arguments" the second "takes one argument". The first is a normal function, the second is a "higher order function".

share|improve this answer
Both are higher order functions. –  us2012 Feb 25 '13 at 4:57
Technically true, they also both take a single argument, though. Perhaps I should scare quote "higher order function". –  J. Abrahamson Feb 25 '13 at 5:00
Yeah, fair enough :) . People take "higher order function" to mean different things in different contexts. –  us2012 Feb 25 '13 at 5:02
I've tended to see "currying" and "HOF" as being thought of as very different components that play together nicely instead of a natural consequence of basing a language on lambda calculus. –  J. Abrahamson Feb 25 '13 at 5:03

Here are two example functions with your types that will help you figure out how these are different:

valatzero :: Num a => (a -> t) -> t
valatzero f = f 0

plus :: Num a => a -> a -> a
plus x y = x + y
share|improve this answer

Your Answer


