Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Currying

From Wikipedia, the free encyclopedia
Transforming a function in such a way that it only takes a single argument
This article is about the mathematical technique. For the cooking process of this name, seeCurry. For the leather finishing process, seeCurrier. For horse grooming, seeCurrycomb.

Inmathematics andcomputer science,currying is the technique of translating afunction that takes multiplearguments into a sequence of families of functions, each taking a single argument.

In the prototypical example, one begins with a functionf:(X×Y)Z{\displaystyle f:(X\times Y)\to Z} that takes two arguments, one fromX{\displaystyle X} and one fromY,{\displaystyle Y,} and produces objects inZ.{\displaystyle Z.} The curried form of this function treats the first argument as a parameter, so as to create a family of functionsfx:YZ.{\displaystyle f_{x}:Y\to Z.} The family is arranged so that for each objectx{\displaystyle x} inX,{\displaystyle X,} there is exactly one functionfx{\displaystyle f_{x}}, such that for anyy{\displaystyle y} inY{\displaystyle Y},fx(y)=f(x,y){\displaystyle f_{x}(y)=f(x,y)}.

In this example,curry{\displaystyle {\mbox{curry}}} itself becomes a function that takesf{\displaystyle f} as an argument, and returns a function that maps eachx{\displaystyle x} tofx.{\displaystyle f_{x}.} The proper notation for expressing this is verbose. The functionf{\displaystyle f} belongs to the set of functions(X×Y)Z.{\displaystyle (X\times Y)\to Z.} Meanwhile,fx{\displaystyle f_{x}} belongs to the set of functionsYZ.{\displaystyle Y\to Z.} Thus, something that mapsx{\displaystyle x} tofx{\displaystyle f_{x}} will be of the typeX[YZ].{\displaystyle X\to [Y\to Z].} With this notation,curry{\displaystyle {\mbox{curry}}} is a function that takes objects from the first set, and returns objects in the second set, and so one writescurry:[(X×Y)Z](X[YZ]).{\displaystyle {\mbox{curry}}:[(X\times Y)\to Z]\to (X\to [Y\to Z]).} This is a somewhat informal example; more precise definitions of what is meant by "object" and "function" are given below. These definitions vary from context to context, and take different forms, depending on the theory that one is working in.

Currying is related to, but not the same as,partial application.[1][2] The example above can be used to illustrate partial application; it is quite similar. Partial application is the functionapply{\displaystyle {\mbox{apply}}} that takes the pairf{\displaystyle f} andx{\displaystyle x} together as arguments, and returnsfx.{\displaystyle f_{x}.} Using the same notation as above, partial application has the signatureapply:([(X×Y)Z]×X)[YZ].{\displaystyle {\mbox{apply}}:([(X\times Y)\to Z]\times X)\to [Y\to Z].} Written this way, application can be seen to be adjoint to currying.

The currying of a function with more than two arguments can be defined by induction.

Currying is useful in both practical and theoretical settings. Infunctional programminglanguages, and many others, it provides a way of automatically managing how arguments are passed to functions andexceptions. Intheoretical computer science, it provides a way to study functions with multiple arguments in simpler theoretical models which provide only one argument. The most general setting for the strict notion of currying and uncurrying is in theclosed monoidal categories, which underpins a vast generalization of theCurry–Howard correspondence of proofs and programs to a correspondence with many other structures, includingquantum mechanics,cobordisms, andstring theory.[3]

The concept of currying was introduced byGottlob Frege,[4][5] developed byMoses Schönfinkel,[6][5][7][8][9][10][11]and further developed byHaskell Curry.[8][10][12][13]

Uncurrying is thedual transformation to currying, and can be seen as a form ofdefunctionalization. It takes a functionf{\displaystyle f} whose return value is another functiong{\displaystyle g}, and yields a new functionf{\displaystyle f'} that takes as parameters the arguments for bothf{\displaystyle f} andg{\displaystyle g}, and returns, as a result, the application off{\displaystyle f} and subsequently,g{\displaystyle g}, to those arguments. The process can be iterated.

Motivation

[edit]

Currying provides a way for working with functions that take multiple arguments, and using them in frameworks where functions might take only one argument. For example, someanalytical techniques can only be applied tofunctions with a single argument. Practical functions frequently take more arguments than this.Frege showed that it was sufficient to provide solutions for the single argument case, as it was possible to transform a function with multiple arguments into a chain of single-argument functions instead. This transformation is the process now known as currying.[14] All "ordinary" functions that might typically be encountered inmathematical analysis or incomputer programming can be curried. However, there are categories in which currying is not possible; the most general categories which allow currying are theclosed monoidal categories.

Someprogramming languages almost always use curried functions to achieve multiple arguments; notable examples areML andHaskell, where in both cases all functions have exactly one argument. This property is inherited fromlambda calculus, where multi-argument functions are usually represented in curried form.

Currying is related to, but not the same aspartial application.[1][2] In practice, the programming technique ofclosures can be used to perform partial application and a kind of currying, by hiding arguments in an environment that travels with the curried function.

History

[edit]

The "Curry" in "Currying" is a reference to logicianHaskell Curry, who used the concept extensively, butMoses Schönfinkel had the idea six years before Curry.[10] The alternative name "Schönfinkelisation" has been proposed.[15] In the mathematical context, the principle can be traced back to work in 1893 byFrege.[4][5]

The originator of the word "currying" is not clear.David Turner says the word was coined byChristopher Strachey in his 1967 lecture notesFundamental Concepts in Programming Languages,[16] but that source introduces the concept as "a device originated by Schönfinkel", and the term "currying" is not used, while Curry is mentioned later in the context of higher-order functions.[7]John C. Reynolds defined "currying" in a 1972 paper, but did not claim to have coined the term.[8]

Definition

[edit]

Currying is most easily understood by starting with an informal definition, which can then be molded to fit many different domains. First, there is some notation to be established. The notationXY{\displaystyle X\to Y} denotes allfunctions fromX{\displaystyle X} toY{\displaystyle Y}. Iff{\displaystyle f} is such a function, we writef:XY{\displaystyle f\colon X\to Y}. LetX×Y{\displaystyle X\times Y} denote theordered pairs of the elements ofX{\displaystyle X} andY{\displaystyle Y} respectively, that is, theCartesian product ofX{\displaystyle X} andY{\displaystyle Y}. Here,X{\displaystyle X} andY{\displaystyle Y} may be sets, or they may be types, or they may be other kinds of objects, as explored below.

Given a function

f:(X×Y)Z{\displaystyle f\colon (X\times Y)\to Z},

currying constructs a new function

g:X(YZ){\displaystyle g\colon X\to (Y\to Z)}.

That is,g{\displaystyle g} takes an argument of typeX{\displaystyle X} and returns a function of typeYZ{\displaystyle Y\to Z}. It is defined by

g(x)(y)=f(x,y){\displaystyle g(x)(y)=f(x,y)}

forx{\displaystyle x} of typeX{\displaystyle X} andy{\displaystyle y} of typeY{\displaystyle Y}. We then also write

curry(f)=g.{\displaystyle {\text{curry}}(f)=g.}

Uncurrying is the reverse transformation, and is most easily understood in terms of its right adjoint, thefunctionapply.{\displaystyle \operatorname {apply} .}

Set theory

[edit]

Inset theory, the notationYX{\displaystyle Y^{X}} is used to denote theset of functions from the setX{\displaystyle X} to the setY{\displaystyle Y}. Currying is thenatural bijection between the setAB×C{\displaystyle A^{B\times C}} of functions fromB×C{\displaystyle B\times C} toA{\displaystyle A}, and the set(AC)B{\displaystyle (A^{C})^{B}} of functions fromB{\displaystyle B} to the set of functions fromC{\displaystyle C} toA{\displaystyle A}. In symbols:

AB×C(AC)B{\displaystyle A^{B\times C}\cong (A^{C})^{B}}

Indeed, it is this natural bijection that justifies theexponential notation for the set of functions. As is the case in all instances of currying, the formula above describes anadjoint pair of functors: for every fixed setC{\displaystyle C}, the functorBB×C{\displaystyle B\mapsto B\times C} is left adjoint to the functorAAC{\displaystyle A\mapsto A^{C}}.

In thecategory of sets, theobjectYX{\displaystyle Y^{X}} is called theexponential object.

Function spaces

[edit]

In the theory offunction spaces, such as infunctional analysis orhomotopy theory, one is commonly interested incontinuous functions betweentopological spaces. One writesHom(X,Y){\displaystyle {\text{Hom}}(X,Y)} (theHom functor) for the set ofall functions fromX{\displaystyle X} toY{\displaystyle Y}, and uses the notationYX{\displaystyle Y^{X}} to denote the subset of continuous functions. Here,curry{\displaystyle {\text{curry}}} is thebijection

curry:Hom(X×Y,Z)Hom(X,Hom(Y,Z)),{\displaystyle {\text{curry}}:{\text{Hom}}(X\times Y,Z)\to {\text{Hom}}(X,{\text{Hom}}(Y,Z)),}

while uncurrying is the inverse map. If the setYX{\displaystyle Y^{X}} of continuous functions fromX{\displaystyle X} toY{\displaystyle Y} is given thecompact-open topology, and if the spaceY{\displaystyle Y} islocally compact Hausdorff, then

curry:ZX×Y(ZY)X{\displaystyle {\text{curry}}:Z^{X\times Y}\to (Z^{Y})^{X}}

is ahomeomorphism. This is also the case whenX{\displaystyle X},Y{\displaystyle Y} andYX{\displaystyle Y^{X}} arecompactly generated,[17]: chapter 5 [18] although there are more cases.[19][20]

One useful corollary is that a function is continuousif and only if its curried form is continuous. Another important result is that theapplication map, usually called "evaluation" in this context, is continuous (note thateval is a strictly different concept in computer science.) That is,

eval:YX×XY(f,x)f(x){\displaystyle {\begin{aligned}&&{\text{eval}}:Y^{X}\times X\to Y\\&&(f,x)\mapsto f(x)\end{aligned}}}

is continuous whenYX{\displaystyle Y^{X}} is compact-open andY{\displaystyle Y} locally compact Hausdorff.[21] These two results are central for establishing the continuity ofhomotopy, i.e. whenX{\displaystyle X} is the unit intervalI{\displaystyle I}, so thatZI×Y(ZY)I{\displaystyle Z^{I\times Y}\cong (Z^{Y})^{I}} can be thought of as either a homotopy of two functions fromY{\displaystyle Y} toZ{\displaystyle Z}, or, equivalently, a single (continuous) path inZY{\displaystyle Z^{Y}}.

Algebraic topology

[edit]

Inalgebraic topology, currying serves as an example ofEckmann–Hilton duality, and, as such, plays an important role in a variety of different settings. For example,loop space is adjoint toreduced suspensions; this is commonly written as

[ΣX,Z][X,ΩZ]{\displaystyle [\Sigma X,Z]\approxeq [X,\Omega Z]}

where[A,B]{\displaystyle [A,B]} is the set ofhomotopy classes of mapsAB{\displaystyle A\rightarrow B}, andΣA{\displaystyle \Sigma A} is thesuspension ofA, andΩA{\displaystyle \Omega A} is theloop space ofA. In essence, the suspensionΣX{\displaystyle \Sigma X} can be seen as the cartesian product ofX{\displaystyle X} with the unit interval, modulo an equivalence relation to turn the interval into a loop. The curried form then maps the spaceX{\displaystyle X} to the space of functions from loops intoZ{\displaystyle Z}, that is, fromX{\displaystyle X} intoΩZ{\displaystyle \Omega Z}.[21] Thencurry{\displaystyle {\text{curry}}} is theadjoint functor that maps suspensions to loop spaces, and uncurrying is the dual.[21]

The duality between themapping cone and the mapping fiber (cofibration andfibration)[17]: chapters 6,7  can be understood as a form of currying, which in turn leads to the duality of thelong exact and coexactPuppe sequences.

Inhomological algebra, the relationship between currying and uncurrying is known astensor-hom adjunction. Here, an interesting twist arises: theHom functor and thetensor product functor might notlift to anexact sequence; this leads to the definition of theExt functor and theTor functor.

Domain theory

[edit]

Inorder theory, the theory oflattices ofpartially ordered sets,curry{\displaystyle {\text{curry}}} is acontinuous function when the lattice is given theScott topology.[22] Scott-continuous functions were first investigated in the attempt to provide a semantics forlambda calculus (as ordinary set theory is inadequate to do this). More generally, Scott-continuous functions are now studied indomain theory, which encompasses the study ofdenotational semantics of computer algorithms. Note that the Scott topology is quite different than many common topologies one might encounter in thecategory of topological spaces; the Scott topology is typicallyfiner, and is notsober.

The notion of continuity makes its appearance inhomotopy type theory, where, roughly speaking, two computer programs can be considered to be homotopic, i.e. compute the same results, if they can be "continuously"refactored from one to the other.

Lambda calculi

[edit]

Intheoretical computer science, currying provides a way to study functions with multiple arguments in very simple theoretical models, such as thelambda calculus, in which functions only take a single argument. Consider a functionf(x,y){\displaystyle f(x,y)} taking two arguments, and having the type(X×Y)Z{\displaystyle (X\times Y)\to Z}, which should be understood to mean thatx must have the typeX{\displaystyle X},y must have the typeY{\displaystyle Y}, and the function itself returns the typeZ{\displaystyle Z}. The curried form off is defined as

curry(f)=λx.(λy.(f(x,y))){\displaystyle {\text{curry}}(f)=\lambda x.(\lambda y.(f(x,y)))}

whereλ{\displaystyle \lambda } is the abstractor of lambda calculus. Since curry takes, as input, functions with the type(X×Y)Z{\displaystyle (X\times Y)\to Z}, one concludes that the type of curry itself is

curry:((X×Y)Z)(X(YZ)){\displaystyle {\text{curry}}:((X\times Y)\to Z)\to (X\to (Y\to Z))}

The → operator is often consideredright-associative, so the curried function typeX(YZ){\displaystyle X\to (Y\to Z)} is often written asXYZ{\displaystyle X\to Y\to Z}. Conversely,function application is considered to beleft-associative, so thatf(x,y){\displaystyle f(x,y)} is equivalent to

((curry(f)x)y)=curry(f)xy{\displaystyle (({\text{curry}}(f)\;x)\;y)={\text{curry}}(f)\;x\;y}.

That is, the parenthesis are not required to disambiguate the order of the application.

Curried functions may be used in anyprogramming language that supportsclosures; 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.

Type theory

[edit]

Intype theory, the general idea of atype system in computer science is formalized into a specific algebra of types. For example, when writingf:XY{\displaystyle f\colon X\to Y}, the intent is thatX{\displaystyle X} andY{\displaystyle Y} aretypes, while the arrow{\displaystyle \to } is atype constructor, specifically, thefunction type or arrow type. Similarly, the Cartesian productX×Y{\displaystyle X\times Y} of types is constructed by theproduct type constructor×{\displaystyle \times }.

The type-theoretical approach is expressed in programming languages such asML and the languages derived from and inspired by it:Caml,Haskell, andF#.

The type-theoretical approach provides a natural complement to the language ofcategory theory, as discussed below. This is because categories, and specifically,monoidal categories, have aninternal language, withsimply typed lambda calculus being the most prominent example of such a language. It is important in this context, because it can be built from a single type constructor, the arrow type. Currying then endows the language with a natural product type. The correspondence between objects in categories and types then allows programming languages to be re-interpreted as logics (viaCurry–Howard correspondence), and as other types of mathematical systems, as explored further, below.

Logic

[edit]

Under theCurry–Howard correspondence, the existence of currying and uncurrying is equivalent to the logical theorem((AB)C)(A(BC)){\displaystyle ((A\land B)\to C)\Leftrightarrow (A\to (B\to C))} (also known asexportation), astuples (product type) corresponds to conjunction in logic, and function type corresponds to implication.

Theexponential objectQP{\displaystyle Q^{P}} in the category ofHeyting algebras is normally written asmaterial implicationPQ{\displaystyle P\to Q}. Distributive Heyting algebras areBoolean algebras, and the exponential object has the explicit form¬PQ{\displaystyle \neg P\lor Q}, thus making it clear that the exponential object really ismaterial implication.[23]

Category theory

[edit]

The above notions of currying and uncurrying find their most general, abstract statement incategory theory. Currying is auniversal property of anexponential object, and gives rise to anadjunction incartesian closed categories. That is, there is anaturalisomorphism between themorphisms from abinary productf:(X×Y)Z{\displaystyle f\colon (X\times Y)\to Z} and the morphisms to an exponential objectg:XZY{\displaystyle g\colon X\to Z^{Y}}.

This generalizes to a broader result inclosed monoidal categories: Currying is the statement that thetensor product and theinternal Hom areadjoint functors; that is, for every objectB{\displaystyle B} there is anatural isomorphism:

Hom(AB,C)Hom(A,BC).{\displaystyle \mathrm {Hom} (A\otimes B,C)\cong \mathrm {Hom} (A,B\Rightarrow C).}

Here,Hom denotes the (external) Hom-functor of all morphisms in the category, whileBC{\displaystyle B\Rightarrow C} denotes the internal hom functor in the closed monoidal category. For thecategory of sets, the two are the same. When the product is the cartesian product, then the internal homBC{\displaystyle B\Rightarrow C} becomes the exponential objectCB{\displaystyle C^{B}}.

Currying can break down in one of two ways. One is if a category is notclosed, and thus lacks an internal hom functor (possibly because there is more than one choice for such a functor). Another way is if it is notmonoidal, and thus lacks a product (that is, lacks a way of writing down pairs of objects). Categories that do have both products and internal homs are exactly the closed monoidal categories.

The setting of cartesian closed categories is sufficient for the discussion ofclassical logic; the more general setting of closed monoidal categories is suitable forquantum computation.[24]

The difference between these two is that theproduct for cartesian categories (such as thecategory of sets,complete partial orders orHeyting algebras) is just theCartesian product; it is interpreted as anordered pair of items (or a list).Simply typed lambda calculus is theinternal language of cartesian closed categories; and it is for this reason that pairs and lists are the primarytypes in thetype theory ofLISP,Scheme and manyfunctional programming languages.

By contrast, the product formonoidal categories (such asHilbert space and thevector spaces offunctional analysis) is thetensor product. The internal language of such categories islinear logic, a form ofquantum logic; the correspondingtype system is thelinear type system. Such categories are suitable for describingentangled quantum states, and, more generally, allow a vast generalization of theCurry–Howard correspondence toquantum mechanics, tocobordisms inalgebraic topology, and tostring theory.[3] Thelinear type system, andlinear logic are useful for describingsynchronization primitives, such as mutual exclusion locks, and the operation of vending machines.

Contrast with partial function application

[edit]
Main article:Partial application

Currying and partial function application are often conflated.[1][2] One of the significant differences between the two is that a call to a partially applied function returns the result right away, not another function down the currying chain; this distinction can be illustrated clearly for functions whosearity is greater than two.[25]

Given a function of typef:(X×Y×Z)N{\displaystyle f\colon (X\times Y\times Z)\to N}, currying producescurry(f):X(Y(ZN)){\displaystyle {\text{curry}}(f)\colon X\to (Y\to (Z\to N))}. That is, while an evaluation of the first function might be represented asf(1,2,3){\displaystyle f(1,2,3)}, evaluation of the curried function would be represented asfcurried(1)(2)(3){\displaystyle f_{\text{curried}}(1)(2)(3)}, applying each argument in turn to a single-argument function returned by the previous invocation. Note that after callingfcurried(1){\displaystyle f_{\text{curried}}(1)}, we are left with a function that takes a single argument and returns another function, not a function that takes two arguments.

In contrast,partial function application refers to the process of fixing a number of arguments to a function, producing another function of smaller arity. Given the definition off{\displaystyle f} above, we might fix (or 'bind') the first argument, producing a function of typepartial(f):(Y×Z)N{\displaystyle {\text{partial}}(f)\colon (Y\times Z)\to N}. Evaluation of this function might be represented asfpartial(2,3){\displaystyle f_{\text{partial}}(2,3)}. Note that the result of partial function application in this case is a function that takes two arguments.

Intuitively, partial function application says "if you fix the firstargument of the function, you get a function of the remaining arguments". For example, if functiondiv stands for the division operationx/y, thendiv with the parameterx fixed at 1 (i.e.,div 1) is another function: the same as the functioninv that returns the multiplicative inverse of its argument, defined byinv(y) = 1/y.

The practical motivation for partial application is that very often the functions obtained by supplying some but not all of the arguments to a function are useful; for example, many languages have a function or operator similar toplus_one. Partial application makes it easy to define these functions, for example by creating a function that represents the addition operator with 1 bound as its first argument.

Partial application can be seen as evaluating a curried function at a fixed point, e.g. givenf:(X×Y×Z)N{\displaystyle f\colon (X\times Y\times Z)\to N} andaX{\displaystyle a\in X} thencurry(partial(f)a)(y)(z)=curry(f)(a)(y)(z){\displaystyle {\text{curry}}({\text{partial}}(f)_{a})(y)(z)={\text{curry}}(f)(a)(y)(z)} or simplypartial(f)a=curry1(f)(a){\displaystyle {\text{partial}}(f)_{a}={\text{curry}}_{1}(f)(a)} wherecurry1{\displaystyle {\text{curry}}_{1}} curries f's first parameter.

Thus, partial application is reduced to a curried function at a fixed point. Further, a curried function at a fixed point is (trivially), a partial application. For further evidence, note that, given any functionf(x,y){\displaystyle f(x,y)}, a functiong(y,x){\displaystyle g(y,x)} may be defined such thatg(y,x)=f(x,y){\displaystyle g(y,x)=f(x,y)}. Thus, any partial application may be reduced to a single curry operation. As such, curry is more suitably defined as an operation which, in many theoretical cases, is often applied recursively, but which is theoretically indistinguishable (when considered as an operation) from a partial application.

So, a partial application can be defined as the objective result of a single application of the curry operator on some ordering of the inputs of some function.

See also

[edit]

References

[edit]
  1. ^abccdiggins (24 May 2007)."Currying != Generalized Partial Application?!".Lambda the Ultimate: The Programming Languages Weblog.
  2. ^abc"Partial Function Application is not Currying".The Uncarved Block. 7 August 2020.Archived from the original on 23 October 2016.
  3. ^abBaez, John C.; Stay, Mike (6 June 2009). "Physics, Topology, Logic and Computation: A Rosetta Stone". In Coecke, Bob (ed.).New Structures for Physics(PDF). Lecture Notes in Physics. Vol. 813: New Structures for Physics. Berlin, Heidelberg: Springer (published 5 July 2010). pp. 95–172.arXiv:0903.0340.doi:10.1007/978-3-642-12821-9_2.ISBN 978-3-642-12821-9.S2CID 115169297. Archived fromthe original(PDF) on 5 December 2022.
  4. ^abFrege, Gottlob (1893)."§ 36".Grundgesetze der arithmetik (in German). Book from the collections of University of Wisconsin - Madison, digitized by Google on 26 August 2008. Jena: Hermann Pohle. pp. 54–55.
  5. ^abcQuine, W. V. (1967). "Introduction to Moses Schönfinkel's 1924 "On the building blocks of mathematical logic"". In van Heijenoort, Jean (ed.).From Frege to Gödel: A Source Book in Mathematical Logic, 1879-1931. Harvard University Press. pp. 355–357.ISBN 9780674324497.
  6. ^Schönfinkel, Moses (September 1924) [Presented at the Mathematischen Gesellschaft (Mathematical Society) in Göttingen on 7 December 1920. Received by Mathematische Annalen on 15 March 1924.]."Über die Bausteine der mathematischen Logik" [On the building blocks of mathematical logic](PDF).Mathematische Annalen.92 (3–4). Berlin: Springer:305–316.doi:10.1007/BF01448013.S2CID 118507515.
  7. ^abStrachey, Christopher (April 2000) [This paper forms the substance of a course of lectures given at the International Summer School in Computer Programming at Copenhagen in August, 1967.]."Fundamental Concepts in Programming Languages".Higher-Order and Symbolic Computation.13:11–49.CiteSeerX 10.1.1.332.3161.doi:10.1023/A:1010000313106.ISSN 1573-0557.S2CID 14124601.There is a device originated by Schönfinkel, for reducing operators with several operands to the successive application of single operand operators.
  8. ^abcOriginally published asReynolds, John C. (1 August 1972)."Definitional interpreters for higher-order programming languages". In Shields, Rosemary (ed.).Proceedings of the ACM annual conference - ACM '72. Vol. 2. ACM Press. pp. 717–740.doi:10.1145/800194.805852.ISBN 9781450374927.S2CID 163294.In the last line we have used a trick called Currying (after the logician H. Curry) to solve the problem of introducing a binary operation into a language where all functions must accept a single argument. (The referee comments that although "Currying" is tastier, "Schönfinkeling" might be more accurate.)Republished asReynolds, John C. (1998)."Definitional Interpreters for Higher-Order Programming Languages".Higher-Order and Symbolic Computation.11 (4). Boston: Kluwer Academic Publishers:363–397.doi:10.1023/A:1010027404223. 13 – via Syracuse University: College of Engineering and Computer Science - Former Departments, Centers, Institutes and Projects.
  9. ^Slonneger, Kenneth; Kurtz, Barry L. (1995). "Curried Functions, 5.1: Concepts and Examples, Chapter 5: The Lambda Calculus".Formal Syntax and Semantics of Programming Languages: A Laboratory Based Approach(PDF). Addison-Wesley Publishing Company. p. 144.ISBN 0-201-65697-3.
  10. ^abcCurry, Haskell B. (1980). Barwise, Jon; Keisler, H. Jerome; Kunen, Kenneth (eds.). "Some Philosophical Aspects of Combinatory Logic".The Kleene Symposium: Proceedings of the Symposium Held June 18-24, 1978 at Madison, Wisconsin, U.S.A. (Studies in Logic and the Foundations of Mathematics). Studies in Logic and the Foundations of Mathematics.101. North-Holland Publishing Company, imprint of Elsevier:85–101.doi:10.1016/S0049-237X(08)71254-0.ISBN 9780444853455.ISSN 0049-237X.S2CID 117179133.Some contemporary logicians call this way of looking at a function "currying", because I made extensive use of it; but Schönfinkel had the idea some 6 years before I did.
  11. ^"Currying Schonfinkelling".Portland Pattern Repository Wiki. Cunningham & Cunningham, Inc. 6 May 2012.
  12. ^Barendregt, Henk; Barendsen, Erik (March 2000) [December 1998].Introduction to Lambda Calculus(PDF) (Revised ed.). p. 8.
  13. ^Curry, Haskell; Feys, Robert (1958).Combinatory logic. Vol. I (2 ed.). Amsterdam, Netherlands: North-Holland Publishing Company.
  14. ^Hutton, Graham; Jones, Mark P., eds. (November 2002)."Frequently Asked Questions for comp.lang.functional, 3. Technical topics, 3.2. Currying".University of Nottingham Computer Science.
  15. ^Heim, Irene; Kratzer, Angelika (January 2, 1998).Semantics in Generative Grammar(PDF). Malden, Massachusetts: Blackwell Publishers, an imprint of Wiley.ISBN 0-631-19712-5.
  16. ^Turner, David (1 Jun 1997)."Programming language, Currying, or Schonfinkeling?, #9 / 14".Computer Programming Language Forum.Archived from the original on 3 March 2022. Retrieved3 March 2022.
  17. ^abMay, Jon Peter (1999).A concise course in algebraic topology(PDF). Chicago lectures in mathematics. Chicago, Ill.: University of Chicago Press. pp. 39–55.ISBN 0-226-51183-9.OCLC 41266205.
  18. ^"compactly generated topological space".nLab. 28 May 2023.
  19. ^Tillotson, J.; Booth, Peter I. (March 1980) [Received 2 October 1978, revised 29 June 1979, published 1 May 1980]. Written at Memorial University of Newfoundland."Monoidal closed, Cartesian closed and convenient categories of topological spaces"(PDF).Pacific Journal of Mathematics.88 (1). Berkeley, California: Mathematical Sciences Publishers:35–53.doi:10.2140/pjm.1980.88.35.eISSN 1945-5844.ISSN 0030-8730.
  20. ^"convenient category of topological spaces".nLab. 11 August 2023.
  21. ^abcRotman, Joseph Jonah (1988). "Chapter 11".An introduction to algebraic topology. Graduate texts in mathematics; 119. New York: Springer-Verlag.ISBN 978-0-387-96678-6.OCLC 17383909.
  22. ^Barendregt, Hendrik Pieter (1984). "Theorems 1.2.13, 1.2.14".The lambda calculus: its syntax and semantics. Studies in logic and the foundations of mathematics. Vol. 103 (Rev. ed.). North-Holland, an imprint of Elsevier.ISBN 978-0-444-87508-2.
  23. ^Mac Lane, Saunders; Moerdijk, Ieke (1992)."Chapter I. Categories of Functors; sections 7. Propositional Calculus, 8. Heyting Algebras, and 9. Quantifiers as Adjoints".Sheaves in Geometry and Logic: A First Introduction to Topos Theory. New York: Springer-Verlag, part of Springer Science & Business Media. pp. 48–57.ISBN 978-0-387-97710-2.
  24. ^Abramsky, Samson; Coecke, Bob (5 March 2007). "A categorical semantics of quantum protocols".Logic in Computer Science (LICS 2004): Proceedings, 19th Annual IEEE Symposium, Turku, Finland, 2004]. IEEE Computer Society Press. pp. 415–425.arXiv:quant-ph/0402130.doi:10.1109/LICS.2004.1319636.ISBN 978-0-7695-2192-3.
  25. ^Lee, G. Kay (15 May 2013)."Functional Programming in 5 Minutes".Slides.

External links

[edit]
Look upcurrying in Wiktionary, the free dictionary.
Namesakes:mathematics,
computer programming
Programming languages
Gang of Four
patterns
Creational
Structural
Behavioral
Concurrency
patterns
Architectural
patterns
Other
patterns
Books
People
Communities
See also
Retrieved from "https://en.wikipedia.org/w/index.php?title=Currying&oldid=1333393842"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp