The values that FP programs map into one another comprise a set which is closed under sequence formation:
These values can be built from any set of atoms: booleans, integers, reals, characters, etc.:
⊥ is the undefined value, or bottom. Sequences are bottom-preserving:
FP programs are functions f that each map a single value x into another:
Functions are either primitive (i.e., provided with the FP environment) or are built from the primitives by program-forming operations (also called functionals).
An example of primitive function is constant, which transforms a value x into the constant-valued function x̄. Functions are strict:
Another example of a primitive function is the selector function family, denoted by 1,2,... where:
In contrast to primitive functions, functionals operate on other functions. For example, some functions have a unit value, such as 0 for addition and 1 for multiplication. The functional unit produces such a value when applied to a function f that has one:
These are the core functionals of FP:
In addition to being constructed from primitives by functionals, a function may be defined recursively by an equation, the simplest kind being:
where Ef is an expression built from primitives, other defined functions, and the function symbol f itself, using functionals.
FP84 is an extension of FP to include infinite sequences, programmer-defined combining forms (analogous to those that Backus himself added to FL, his successor to FP), and lazy evaluation. Unlike FFP, another one of Backus' own variations on FP, FP84 makes a clear distinction between objects and functions: i.e., the latter are no longer represented by sequences of the former. FP84's extensions are accomplished by removing the FP restriction that sequence construction be applied only to non-⊥ objects: in FP84 the entire universe of expressions (including those whose meaning is ⊥) is closed under sequence construction.
FP84's semantics are embodied in an underlying algebra of programs, a set of function-level equalities that may be used to manipulate and reason about programs.
Backus, J. (1978). "Can programming be liberated from the von Neumann style?: A functional style and its algebra of programs". Communications of the ACM. 21 (8): 613. doi:10.1145/359576.359579. https://doi.org/10.1145%2F359576.359579 ↩
"Association for Computing Machinery A. M. Turing Award" (PDF).[permanent dead link] http://signallake.com/innovation/JBackus032007.pdf ↩
Yang, Jean (2017). "Interview with Simon Peyton-Jones". People of Programming Languages. https://www.cs.cmu.edu/~popl-interviews/peytonjones.html ↩
Hague, James (December 28, 2007). "Functional Programming Archaeology". Programming in the Twenty-First Century. http://prog21.dadgum.com/14.html ↩