FP (short for Functional P programming) is a programming language created by John Backus to support the Function-level programming paradigm.
Overview
The values that FP programs map into one another comprise a set which is closed under sequence formation:
if x1,...,xn are values, then the sequence ⟨x1,...,xn⟩ is also a value
These values can be built from any set of atoms: booleans, integers, reals, characters, etc.
FP programs are functions f that each map a single value x into another:
f:x represents the value that results from applying the function f to the value x
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 one such operation is constant, which transforms a value x into the constant-valued function x̄. ⊥ is the undefined value, which all functions map into itself, due to their strict nature.
Functionals
These are are the principal functionals of FP:
constant x̄ where x̄:y = x and x̄:⊥ = ⊥
composition f&#x°g where f&#x°g:x = f:(g:x)
construction [f1,...fn] where [f1,...fn]:x = ⟨f1:x,...,fn:x⟩
condition (h ⇒ f;g) where (h ⇒ f;g):x = f:x if h:x = T and (h ⇒ f;g):x = g:x if h:x = F and (h ⇒ f;g):x = ⊥ otherwise
apply-to-all αf where αf:⟨x1,...,xn⟩ = ⟨f:x1,...,f:xn⟩
insert-right /f where /f:⟨x⟩ = x and /f:⟨x1,x2,...,xn⟩ = f:⟨x1,/f:⟨x2,...,xn⟩⟩
insert-left \f where \f:⟨x⟩ = x and \f:⟨x1,x2,...,xn⟩ = f:⟨\f:⟨x1,...,xn-1⟩,xn⟩