Skip to main content

Functional programming - Wikipedia, the free encyclopedia

Popularity Report

Total Popularity Score: 0

Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

Rank

Bookmark History

Saved by 5 people (0 private), first by anonymouse user on 2006-12-20


Public Sticky notes

Functions are higher-order when they can take other functions as arguments, and return them as results. (The derivative and antiderivative in calculus are examples of this.)

Highlighted by ratbeard

Higher-order functions enable currying, a technique in which a function is applied to its arguments one at a time, with each application returning a new (higher-order) function that accepts the next argument.

Highlighted by ratbeard

The distinction between the two is subtle: "higher-order" describes a mathematical concept of functions that operate on other functions, while "first-class" is a computer science term that describes programming language entities that have no restriction on their use

Highlighted by yorkjong

While most compilers for imperative programming languages detect pure functions, and perform common subexpression elimination for pure function calls

Highlighted by yorkjong

Strict evaluation has efficiency advantages.

Highlighted by ratbeard

Iteration (looping) in functional languages is usually accomplished via recursion.

Highlighted by yorkjong

Lambda calculus provides a stronger theoretic foundation for languages that employ non-strict evaluation.[11] Also non-strict evaluation provides for a more expressive language. For example, it supports infinite data structures, such as a list of all prime numbers (such structures are of use when an indefinite but finite part of the structure is required).

Highlighted by ratbeard

Recursion may require maintaining a stack, but tail recursion can be recognized and optimized by a compiler into the same code used to implement iteration in imperative languages.

Highlighted by yorkjong

Common patterns of recursion can be factored out using higher order functions

Highlighted by yorkjong

Such higher order functions play a role analogous to built-in control structures such as loops in imperative languages.

Highlighted by yorkjong

The most significant differences stem from the fact that functional programming avoids side effects, which are used in imperative programming to implement state and I/O.

Highlighted by yorkjong

Where a traditional imperative program might use a loop to traverse a list, a functional style would often use a higher-order function, map, that takes as arguments a function and a list, applies the function to each element of the list, and returns a list of the results.

Highlighted by yorkjong