Functional programming - Wikipedia, the free encyclopedia
Popularity Report
![]() |
|||
![]() |
|||
![]() |
|||
![]() |
|||
![]() |
|||
![]() |
URL Tag Cloud
Bookmark History
Saved by 5 people (0 private), first by anonymouse user on 2006-12-20
- Ferrari on 2008-05-11 - Tags programming , FP
- Ratbeard on 2007-10-09 - Tags programming
- Yorkjong on 2007-07-01 - Tags functional , programming
- Eliazar on 2006-12-20 - Tags imported:del.icio.us , linkstream , toread
- Magoth on 2006-11-12 - Tags programming , functional-programming
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
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
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


Public Comment