翻訳と辞書
Words near each other
・ "O" Is for Outlaw
・ "O"-Jung.Ban.Hap.
・ "Ode-to-Napoleon" hexachord
・ "Oh Yeah!" Live
・ "Our Contemporary" regional art exhibition (Leningrad, 1975)
・ "P" Is for Peril
・ "Pimpernel" Smith
・ "Polish death camp" controversy
・ "Pro knigi" ("About books")
・ "Prosopa" Greek Television Awards
・ "Pussy Cats" Starring the Walkmen
・ "Q" Is for Quarry
・ "R" Is for Ricochet
・ "R" The King (2016 film)
・ "Rags" Ragland
・ ! (album)
・ ! (disambiguation)
・ !!
・ !!!
・ !!! (album)
・ !!Destroy-Oh-Boy!!
・ !Action Pact!
・ !Arriba! La Pachanga
・ !Hero
・ !Hero (album)
・ !Kung language
・ !Oka Tokat
・ !PAUS3
・ !T.O.O.H.!
・ !Women Art Revolution


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

currying : ウィキペディア英語版
currying

In mathematics and computer science, currying is the technique of translating the evaluation of a function that takes multiple arguments (or a tuple of arguments) into evaluating a sequence of functions, each with a single argument. It was introduced by Moses Schönfinkel〔 (Reprinted lecture notes from 1967.)〕〔Kenneth Slonneger and Barry L. Kurtz. ''Formal Syntax and Semantics of Programming Languages''. p. 144.〕
and later developed by Haskell Curry.〔Henk Barendregt, Erik Barendsen, "(Introduction to Lambda Calculus )", March 2000, page 8.〕
Uncurrying is the dual transformation to currying, and can be seen as a form of defunctionalization. It takes a function ''f''(''x'') that returns another function ''g''(''y'') as a result, and yields a new function that takes a number of additional parameters and applies them to the function returned by function ''f''. The process can be iterated.
==Motivation==
There are analytical techniques that can only be applied to functions 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.
Currying is similar to the process of calculating a function of multiple variables for some given values on paper.
For example, given the function f(x,y) = y / x:
:To evaluate f(2,3), first replace x with 2
:Since the result is a function of y, this new function g(y) can be defined as g(y) = f(2,y) = y/2
:Next, replace the y argument with 3, producing g(3) = f(2,3) = 3/2
On paper, using classical notation, this is usually done all in one step. However, each argument can be replaced sequentially as well. Each replacement results in a function taking exactly one argument. This produces a chain of functions as in lambda calculus, and multi-argument functions are usually represented in curried form.
Some programming languages almost always use curried functions to achieve multiple arguments; notable examples are ML and Haskell, where in both cases all functions have exactly one argument.
If we let ''f'' be a function
:f(x,y) = \frac
then the function ''h'' where
:h(x) = y \mapsto f(x,y)
is a curried version of f. Here, y \mapsto z is a function that maps an argument ''y'' to result ''z''. In particular,
:g(y) = h(2) = y \mapsto f(2,y)
is the curried equivalent of the example above.
Note that currying, while similar, is not the same operation as partial function application.

抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「currying」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.