翻訳と辞書
Words near each other
・ Curry Rivel
・ Curry School of Education
・ Curry Todd
・ Curry Township, Sullivan County, Indiana
・ Curry tree
・ Curry Village, California
・ Curry Without Worry
・ Curry's bat
・ Curry's paradox
・ Curry, Alabama
・ Curry, Alaska
・ Curry, Pennsylvania
・ Curry, Pike County, Alabama
・ Curry, Talladega County, Alabama
・ Curry, Walker County, Alabama
Currying
・ Currys
・ Currys Digital
・ Currys, Alabama
・ Curryville
・ Curryville, Georgia
・ Curryville, Indiana
・ Curryville, Missouri
・ Curryville, New Brunswick
・ Curryville, Sullivan County, Indiana
・ Currywurst
・ Currywurst mit Darm
・ Curry–Howard correspondence
・ Curré Formation
・ Cursa de Bombers


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.