Functional programming

| Main Article
| Discussion
| Definition [?]
| Related Articles  [?]
| Bibliography  [?]
| External Links  [?]
| Citable Version  [?]

|
|
|
|
|
|
|
|
|

This editable Main Article is under development and subject to a disclaimer.

[edit intro]

## Contents

* 1 First class data types
* 2 Input/Output
* 3 Single assignment and proofs
* 4 References

A functional programming language is a language modeled after mathematical functions. Non-functional computer programs allow state changes.

## First class data types[edit]

Functional programs typically make functions first class data types. This allows functions to be passes as arguments to other functions and allows for the creation of higher order functions(functions of functions).

## Input/Output[edit]

In functional programming state is not saved outside of function calls due to restrictions on input/output calls (I/O) State may not change during a function call. Restricting I/O protects against side effects, such as bad distant changes I/O caused by local computation .

## Single assignment and proofs[edit]

Single assignment makes a computation into a dataflow. Dataflows are easy for compilers to understand. When state is fixed, functions can be treated similar to mathematical functions and facts can be proved about such functions. Some functional programs can be proved to be equal to each other or proved to be stable under certain conditions. Such proofs can aid the efforts of software engineers and computer scientists. [1] Some examples of functional programming languages are:

* Scheme,
* Erlang, (excluding all parallel functions)
* Haskell.

If a functional language is eager then all values are fully computed in the order that they are encountered. In a lazy language like Haskell some arguments are allowed to have delayed evaluation.

## References[edit]

1. ↑ Graham Hutton, 1999 (July 1999), "A tutorial on the universality and expressiveness of fold", J. Functional Programming 9 (4): 355–372