 |
|
| |
|
 |
 |
at Global Oneness Community.
Share your dreams and let others help you with the interpretation!
Dream Sharing Forum
|
 |
Functional programming - Introduction |  | Functional programming - Introduction: Encyclopedia II - Functional programming - Introduction |  | Mathematical functions have great strengths in terms of flexibility and analysis. For example, if a function is known to be idempotent, then a call to a function which has its own output as its argument, and which is known to have no side-effects, may be efficiently computed without multiple calls.
A function in this sense has zero or more parameters and a single return value. The parameters—or arguments, as they are sometimes called—are the inputs to the function, and the return value is the function's output. The definition of a ...
See also:Functional programming, Functional programming - Introduction, Functional programming - History, Functional programming - Comparison with imperative programming, Functional programming - Functional programming languages, Functional programming - Higher-order functions, Functional programming - Speed and space considerations, Functional programming - Functional languages |  | | Functional programming, Functional programming - Comparison with imperative programming, Functional programming - Functional languages, Functional programming - Functional programming languages, Functional programming - Higher-order functions, Functional programming - History, Functional programming - Introduction, Functional programming - Speed and space considerations, Eager evaluation, Lazy evaluation, Purely functional, List of functional programming topics, Function-level programming (compare and contrast), Procedural programming (contrast), Imperative programming (contrast), Programming paradigm |  | |
|  |  | Functional programming: Encyclopedia II - Functional programming - Introduction
Functional programming - Introduction
Mathematical functions have great strengths in terms of flexibility and analysis. For example, if a function is known to be idempotent, then a call to a function which has its own output as its argument, and which is known to have no side-effects, may be efficiently computed without multiple calls.
A function in this sense has zero or more parameters and a single return value. The parameters—or arguments, as they are sometimes called—are the inputs to the function, and the return value is the function's output. The definition of a function describes how the function is to be evaluated in terms of other functions. For example, the function f(x) = x2 + 2 is defined in terms of the power and addition functions. At some point, the language has to provide basic functions that require no further definition.
Functions can be manipulated in a variety of ways in a functional programming language. Functional programming usually requires that functions be first class functions, which is to say that functions can be parameters or inputs to other functions and can be the return values or outputs of a function. This allows functions like mapcar in LISP and map in Haskell that take both a function and a list as input and apply the input function to every element of the list, returning a list of the results. Functions can be named, as in other languages, or defined anonymously (sometimes during program execution) using a lambda abstraction, and used as values in other functions.
Functional languages also allow functions to be curried. Currying is a technique of rewriting a function with multiple parameters as a function with one parameter that maps to another function of one parameter and so on, until all parameters are exhausted. The curried function can be applied to just a subset of its parameters. The result is a function where the parameters in this subset are now fixed as constants, and the values of the rest of the parameters are still unspecified. This new function can be applied to the remaining parameters to get the final function value. For example, a function add(x,y) = x + y can be curried so that the return value of add(2)—notice that there is no y parameter—will be an anonymous function that is equivalent to a function add2(y) = 2 + y. This new function has only one parameter and corresponds to adding 2 to a number. Again, this is possible only because functions are treated as first-class values.
Other related archives1930s, 1950s, 1970s, 1980s, Pure functional, Alonzo Church, C, C programming language, COBOL, CPU, Category:Functional languages, Clean, Common Lisp, David Turner, Dylan, Eager evaluation, Erlang, FORTRAN 77, FP, Function-level programming, Haskell, IBM 700/7000 series, Imperative programming, Information Processing Language, Iteration, J, JOHNNIAC, John Backus, John McCarthy, K, Kenneth E. Iverson, LISP, Lambda calculus, Lazy evaluation, Lisp, List of functional programming topics, Logo, ML, Maple, Massachusetts Institute of Technology, Mathematica, Mathematical functions, Miranda, Nested functions, OCaml, Pascal, Perl, Procedural programming, Programming paradigm, Purely functional, Python, RAND Corporation, Recursive functions, Ruby, SML, Scheme, Scheme programming language, Tcl, University of Edinburgh, University of Kent, Xslt, academics, array, bounds checking, calculus, character, compiler, computation, correctness, curried, debug, differential operator, eager, first class functions, function-level programming, garbage collection, higher-order functions, idempotent, imperative programming, lambda abstraction, lambda calculus, lazy evaluation, mathematical functions, natural language, parallel programming, persistent data structures, procedural, program, programming paradigm, quantum algorithms, recursion, referential transparency, side-effects, software industry, sqrt, stack, standard input, state machines, tail recursion, thread-safe
 Adapted from the Wikipedia article "Introduction", under the G.N U Free Docmentation License. Please also see http://en.wikipedia.org/wiki |
|
|
More material related to Functional Programming can be found here:
|
|
« Back
|
Search the Global Oneness web site |
|
|
|
|
 |
Sneak-Peek of Global Oneness Community
Hi friend! The Global Oneness Community, the place for information and sharing about Oneness is not really launched yet (you will see there is still some clean up to do) ...but it is now open for a sneak-peek! And if you wish - please register and become one of the very first members to do so! Jonas
Forum Home,
Articles,
Photo Gallery,
Videos,
News,
Sitemap
...and much more!
|