| dbpprop:abstract
|
- In mathematics and computer science, higher-order functions, functional forms, or functionals are functions which do at least one of the following: take one or more functions as an input output a function. In mathematics these are also known as operators or functionals. The derivative in calculus is a common example, since it maps a function to another function. In the untyped lambda calculus, all functions are higher-order; in a typed lambda calculus, from which most functional programming languages are derived, higher-order functions are generally those with types containing more than one arrow. In functional programming, higher-order functions that return other functions are said to be curried. The map function found in many functional programming languages is one example of a higher-order function. It takes as arguments a function f and a list of elements, and as result, returns a new list with f applied to each element from the list. Another very common kind of higher-order function in those languages which support them are sorting functions which take a comparison function as a parameter, allowing the programmer to separate the sorting algorithm from the comparisons of the items being sorted. The C standard function qsort, is an example of this. Other examples of higher-order functions include fold, function composition, integration, and the constant-function function λx. λy.x.
- Eine Funktion höherer Ordnung ist in der Mathematik bzw. Theoretischen Informatik eine Funktion, die Funktionen als Argumente erhält oder Funktionen als Ergebnis liefert. Der Begriff wird insbesondere im Lambda-Kalkül verwendet, der theoretischen Grundlage der Funktionalen Programmierung. Dort ist er eng mit dem Currying verbunden, einem Verfahren, das Funktionen mit mehreren Argumenten in mehrere einparametrige Funktionen umwandelt. Diese Transformation hat ihre Grundlage in der Gleichmächtigkeit der Funktionenräume <math>A \times B \to C</math> und <math>A \to (B \to C)</math> für beliebige Mengen <math>A,B,C</math>. Folgende Funktion ist eine Funktion höherer Ordnung: <math>f: \mathbb{R} \to (\mathbb{N} \to \mathbb{R})</math> <math>f: x \mapsto (m \mapsto x+m)</math> Diese Funktion bildet jeden x-Wert auf eine Funktion ab, die eine (übergebene) natürliche Zahl zu x addiert. Beispielsweise <math>f(10.5) = (m \mapsto 10.5+m)</math> m wird wiederum auf x+m abgebildet: <math>(f)(1) = 11.5</math> Aus dem Lambda-Kalkül stammt der K-Kombinator <math>K = (x \mapsto)</math>. (K)(y) ist für alle y konstant. Ein bekanntes Beispiel für eine Funktion höherer Ordnung ist der Differentialoperator, weil er Funktionen auf Funktionen abbildet (Ableitung und Stammfunktion). Weitere wichtige Beispiele sind die so genannten Distributionen.
- En Matemàtica o Informàtica funcions d'ordre superior són funcions que compleixen una de dues: prendre una o més funcions com a entrada retornar una funció com a sortida En Matemàtica aquestes funcions s'anomenen operadors o funcionals. En Informàtica se'n poden crear en nombrosos llenguatges de programació però són particularment freqüents en els que incorporen el paradigma de la programació funcional.
- En mathématiques et en informatique, les fonctions d'ordre supérieur ou les fonctionnelles sont des fonctions qui ont au moins une des propriétés suivantes : prendre une ou plusieurs fonctions comme entrée, renvoyer une fonction. En mathématiques, on les appelle des opérateurs ou des fonctionnelles. La dérivée en calcul infinitésimal est un exemple commun : elle associe une fonction à une autre fonction. Dans le lambda-calcul non typé, toutes les fonctions sont d'ordre supérieur. Dans le lambda-calcul typé, dont la plupart des langages de programmation fonctionnels sont issus, les fonctions d'ordre supérieur sont généralement celles dont le type contient plus d'une flèche. En programmation fonctionnelle, les fonctions d'ordre supérieur qui retournent d'autres fonctions sont dites curryfiées. La fonction map présente dans de nombreux langages de programmation fonctionnelle est un exemple de fonction d'ordre supérieur. Elle prend une fonction f comme argument, et retourne une nouvelle fonction qui prend une liste comme argument et applique f à chaque élément. Un autre exemple très courant est celui d'une fonction de tri qui prend en argument une fonction de comparaison; on sépare ainsi l'algorithme de tri de la comparaison des éléments à trier. D'autres exemples de fonction d'ordre supérieur incluent la composition de fonctions, l'intégration, et la fonction constante λx. λy.x.
- Una funzione di ordine superiore (o funzione higher-order) è una funzione che può prendere altre funzioni come parametri e/o restituire funzioni come risultato. L'operatore differenziale in matematica è un esempio di funzione che mappa una funzione ad un'altra funzione. Le funzioni di ordine superiore furono inizialmente studiate dalla teoria del lambda calcolo ben prima che comparissero nei linguaggi di programmazione con i linguaggi funzionali. Sono oggi presenti in molti linguaggi funzionali e non, tra i quali Ruby, Lisp e Haskell. Più in generale si può dire che le funzioni di ordine superiore sono parte del linguaggio naturale. Per esempio, gli avverbi possono modificare i verbi (azioni) creando verbi derivati. Le funzioni di ordine superiore sono cruciali nel paradigma della programmazione a livello funzionale (da non confondere con la programmazione funzionale), che include linguaggi come l'FP di John Backus e il J di Kenneth Eugene Iverson.
- 高階関数(こうかいかんすう、lang-en-short|higher-order function)とは、プログラミング言語において、関数を引数にしたり、あるいは関数を戻り値とするような関数のことである。引数や戻り値の関数もまた高階関数となり得る。これは主に関数型言語やその背景理論であるラムダ計算において多用される。数学でも同様の概念はあり、汎関数と呼ばれる。
- In de wiskunde en in de informatica is een hogere-orde functie een functie die aan één van de volgende voorwaarden voldoet: de functie heeft één of meerdere functies als invoer, de functie levert een functie als uitvoer. In de wiskunde zijn deze ook bekend als operatoren of functionalen. De afgeleide in de analyse is een bekend voorbeeld aangezien het een functie afbeeldt op een andere functie.
- Funkcja wyższego rzędu (ang. higher-order function) - w informatyce jest to funkcja, która zwraca lub przyjmuje jako argument inne funkcje. Tego rodzaju funkcje są powszechnie stosowane w językach funkcyjnych, jak SML, Ocaml, Haskell, jak również w Pythonie. Funkcje wyższego rzędu służą często do dostarczenia generycznych realizacji algorytmów, zaś programista parametryzuje je własnymi funkcjami (nierzadko bardzo prostymi, patrz przykład niżej). W bibliotekach standardowych są spotykane: map (funkcja, lista) — zwraca nową listę, zawierającą wyniki funkcji dla każdego elementu z wejściowej listy (<math></math> <math>\quad\rightarrow\quad</math> <math></math>); filter (funkcja, lista) — zwraca nową listę, składającą się tylko z tych elementów listy wejściowej, dla których funkcja zwróciła prawdę; foldl (wartość początkowa, funkcja, lista) (fold left) — dla wszystkich elementów listy wywoływana jest funkcja, która przyjmuje dwa argumenty - wartość z listy, oraz wynik dla poprzedniego elementu (<math>x_0, </math> <math>\quad\rightarrow\quad</math> <math>f]</math>); foldr (wartość początkowa, funkcja, lista) (fold right) — działanie analogiczne do foldl, z tym że lista jest przeglądana od końca. Przykład ich wykorzystania w SML-u: fun kwadrat x = x*x; (* funkcja podnosząca do kwadratu *) val L = map kwadrat [1,2,3,4,5]; (* L = *) fun niezerowe x = x <> 0; (* funkcja zwraca prawdę gdy x nie jest zerem *) val L = filter niezerowe [0,1,0,0,5,0,0,0]; (* L = *) fun suma (x, y) = x+y; (* funkcja zwraca sumę dwóch liczb *) fun iloczyn (x, y) = x*y; (* ta natomiast iloczyn *) val S = foldl suma 0 [1,2,3,4,5]; (* S = 0+1+2+3+4+5 = 15 *) val I = foldl iloczyn 1 [1,2,3,4,5]; (* I = 1*1*2*3*4*5 = 120 *) Funkcje wyższego rzędu mogą również zwracać inne funkcje, co jest wykorzystywane m. in w curryingu, czyli transformacji funkcji w taki sposób, żeby zamiast przyjmowania ciągu argumentów, przyjmowała tylko jeden, pierwszy argument, oraz zwracała funkcję przyjmującą kolejne argumenty. Np. w wyliczeniu funkcji podano, że funkcja map przyjmuje dwa argumenty (krotkę dwuelementową): funkcję oraz listę; natomiast map SML-owe w istocie przyjmuje jeden argument - funkcję użytkownika, zwraca zaś funkcję przyjmującą jako argument listę i to dopiero ona zwraca ostateczny wynik obliczeń: val NZ = map niezerowe; (* NZ jest funkcją *) val L1 = NZ [0,1,0,0,5,0,0,0]; (* L1 = *) val L2 = NZ [0,0,0,0]; (* L2 = *)
- Фу́нкция вы́сшего поря́дка — функция, принимающая в качестве аргументов другие функции или возвращающая другую функцию в качестве результата. Иногда функции высшего порядка называют функционалами, хотя это не совсем верно, более точный эквивалент — оператор. В функциональных языках программирования все функции являются функциями высшего порядка.
- 在数学和计算机科学中,高阶函数是至少满足下列一个条件的函数: 接受一个或多个函数作为输入 输出一个函数 在数学中它们也叫做算子(运算符)或泛函。微积分中的导数就是常见的例子,因为它映射一个函数到另一个函数。 在无类型 lambda 演算,所有函数都是高阶的;在有类型 lambda 演算(大多数函数式编程语言都从中演化而来)中,高阶函数一般是那些函數型別包含多于一个箭头的函数。在函数式编程中,返回另一个函数的高阶函数被称为Curry化的函数。 在很多函数式编程语言中能找到的 map 函数是高阶函数的一个例子。它接受一个函数 f 作为参数,并返回接受一个列表并应用 f 到它的每个元素的一个函数。 高阶函数的其他例子包括函数复合、积分和常量函数 λx. λy. x。
|
| rdfs:comment
|
- In mathematics and computer science, higher-order functions, functional forms, or functionals are functions which do at least one of the following: take one or more functions as an input output a function. In mathematics these are also known as operators or functionals. The derivative in calculus is a common example, since it maps a function to another function.
- Eine Funktion höherer Ordnung ist in der Mathematik bzw. Theoretischen Informatik eine Funktion, die Funktionen als Argumente erhält oder Funktionen als Ergebnis liefert. Der Begriff wird insbesondere im Lambda-Kalkül verwendet, der theoretischen Grundlage der Funktionalen Programmierung. Dort ist er eng mit dem Currying verbunden, einem Verfahren, das Funktionen mit mehreren Argumenten in mehrere einparametrige Funktionen umwandelt.
- En Matemàtica o Informàtica funcions d'ordre superior són funcions que compleixen una de dues: prendre una o més funcions com a entrada retornar una funció com a sortida En Matemàtica aquestes funcions s'anomenen operadors o funcionals. En Informàtica se'n poden crear en nombrosos llenguatges de programació però són particularment freqüents en els que incorporen el paradigma de la programació funcional.
- En mathématiques et en informatique, les fonctions d'ordre supérieur ou les fonctionnelles sont des fonctions qui ont au moins une des propriétés suivantes : prendre une ou plusieurs fonctions comme entrée, renvoyer une fonction. En mathématiques, on les appelle des opérateurs ou des fonctionnelles. La dérivée en calcul infinitésimal est un exemple commun : elle associe une fonction à une autre fonction. Dans le lambda-calcul non typé, toutes les fonctions sont d'ordre supérieur.
- Una funzione di ordine superiore (o funzione higher-order) è una funzione che può prendere altre funzioni come parametri e/o restituire funzioni come risultato. L'operatore differenziale in matematica è un esempio di funzione che mappa una funzione ad un'altra funzione. Le funzioni di ordine superiore furono inizialmente studiate dalla teoria del lambda calcolo ben prima che comparissero nei linguaggi di programmazione con i linguaggi funzionali.
- 高階関数(こうかいかんすう、lang-en-short|higher-order function)とは、プログラミング言語において、関数を引数にしたり、あるいは関数を戻り値とするような関数のことである。引数や戻り値の関数もまた高階関数となり得る。これは主に関数型言語やその背景理論であるラムダ計算において多用される。数学でも同様の概念はあり、汎関数と呼ばれる。
- In de wiskunde en in de informatica is een hogere-orde functie een functie die aan één van de volgende voorwaarden voldoet: de functie heeft één of meerdere functies als invoer, de functie levert een functie als uitvoer. In de wiskunde zijn deze ook bekend als operatoren of functionalen. De afgeleide in de analyse is een bekend voorbeeld aangezien het een functie afbeeldt op een andere functie.
- Funkcja wyższego rzędu (ang. higher-order function) - w informatyce jest to funkcja, która zwraca lub przyjmuje jako argument inne funkcje. Tego rodzaju funkcje są powszechnie stosowane w językach funkcyjnych, jak SML, Ocaml, Haskell, jak również w Pythonie. Funkcje wyższego rzędu służą często do dostarczenia generycznych realizacji algorytmów, zaś programista parametryzuje je własnymi funkcjami (nierzadko bardzo prostymi, patrz przykład niżej).
- Фу́нкция вы́сшего поря́дка — функция, принимающая в качестве аргументов другие функции или возвращающая другую функцию в качестве результата. Иногда функции высшего порядка называют функционалами, хотя это не совсем верно, более точный эквивалент — оператор.
|