Definition
Given a function f of type, currying it makes a function . That is, takes an argument of type and returns a function of type . Uncurrying is the reverse transformation, and is most easily understood in terms of its right adjoint, apply.
The → operator is often considered right-associative, so the curried function type is often written as . Conversely, function application is considered to be left-associative, so that is equivalent to .
Curried functions may be used in any language that supports closures; however, uncurried functions are generally preferred for efficiency reasons, since the overhead of partial application and closure creation can then be avoided for most function calls.
Read more about this topic: Currying
Famous quotes containing the word definition:
“The man who knows governments most completely is he who troubles himself least about a definition which shall give their essence. Enjoying an intimate acquaintance with all their particularities in turn, he would naturally regard an abstract conception in which these were unified as a thing more misleading than enlightening.”
—William James (18421910)
“One definition of man is an intelligence served by organs.”
—Ralph Waldo Emerson (18031882)
“... if, as women, we accept a philosophy of history that asserts that women are by definition assimilated into the male universal, that we can understand our past through a male lensif we are unaware that women even have a historywe live our lives similarly unanchored, drifting in response to a veering wind of myth and bias.”
—Adrienne Rich (b. 1929)