All Topics  
FP programming language

 

   Email Print
   Bookmark   Link






 

FP programming language



 
 
FP (short for Function Programming) is a programming language
Programming language

A programming language is a machine-readable artificial language designed to express computations that can be performed by a machine, particularly a computer....
 created by John Backus
John Backus

For the physicist, see John Backus John Warner Backus was an American computer scientist. He led the team that invented the first widely used High-level programming language programming language and was the inventor of the Backus-Naur form , the almost universally used notation to define formal language syntax....
 to support the function-level programming
Function-level programming

In computer science, function-level programming refers to one of the two contrasting programming paradigms identified by John Backus in his work on programs as mathematical objects, the other being value-level programming....
 paradigm. This allows for the elimination of named variables.

boolean : integer : character : symbol :

? is the undefined value, or bottom.






Discussion
Ask a question about 'FP programming language'
Start a new discussion about 'FP programming language'
Answer questions from other users
Full Discussion Forum



Encyclopedia


FP (short for Function Programming) is a programming language
Programming language

A programming language is a machine-readable artificial language designed to express computations that can be performed by a machine, particularly a computer....
 created by John Backus
John Backus

For the physicist, see John Backus John Warner Backus was an American computer scientist. He led the team that invented the first widely used High-level programming language programming language and was the inventor of the Backus-Naur form , the almost universally used notation to define formal language syntax....
 to support the function-level programming
Function-level programming

In computer science, function-level programming refers to one of the two contrasting programming paradigms identified by John Backus in his work on programs as mathematical objects, the other being value-level programming....
 paradigm. This allows for the elimination of named variables.

Overview


The values that FP programs map into one another comprise a set
Set

A set is a collection of distinct objects, considered as an object in its own right. Sets are one of the most fundamental concepts in mathematics....
 which is closed
Closed

Closed may refer to:Math* Closure * Closed manifold* Orbit #Closed Orbits* Closed set* One-formOther* Cloister, a closed walkway...
 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.: boolean : integer : character : symbol :

? is the undefined value, or bottom. Sequences are bottom-preserving:

<x1,...,?,...,xn> = ?

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 primitive function is constant, which transforms a value x into the constant-valued function . Functions are strict
Strict function

A strict function in the denotational semantics of programming languages is a function f where . The entity , called "Bottom element", denotes an expression which does not return a normal value, either because it loops endlessly or because it aborts due to an error such as division by zero....
: f:? = ?

Another example of a primitive function is the selector function family, denoted by 1,2,... where: 1:<x1,...,xn> = x1 i:<x1,...,xn> = xi if 0 < i = n = ? otherwise

Functionals


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: unit + = 0 unit × = 1 unit foo = ?

These are the core functionals of FP:

composition f°gwhere f°g:x = f

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 = g:x if h:x = F = ? otherwise

apply-to-all af where af:<x1,...,xn> = <f:x1,...,f:xn>

insert-right /f where /f:<x> = x and /f:<x1,x2,...,xn> = f:<x1,/f:<x2,...,xn>> and /f:< > = unit f

insert-left \f where \f:<x> = x and \f:<x1,x2,...,xn> = f:<\f:<x1,...,xn-1>,xn> and \f:< > = unit f

Equational functions


In addition to being constructed from primitives by functionals, a function may be defined recursively by an equation, the simplest kind being: f = Ef where E'f is an expression
Expression (programming)

An expression in a programming language is a combination of value s, variables, operator s, and function s that are interpreted according to the particular Order of operations and of association for a particular programming language, which computes and then produces another value....
 built from primitives, other defined functions, and the function symbol f itself, using functionals.

See also

  • FL programming language
    FL programming language

    FL is a programming language created at the IBM Almaden Research Center by John Backus, John Williams, and Edward Wimmers in 1989.FL was designed as a successor of Backus' earlier FP programming language, providing specific support for what Backus termed function-level programming....
     (Backus' successor to FP)
  • Function-level programming
    Function-level programming

    In computer science, function-level programming refers to one of the two contrasting programming paradigms identified by John Backus in his work on programs as mathematical objects, the other being value-level programming....
  • Programs as mathematical objects
    Programs as mathematical objects

    A program is a mathematical space suggested by John Backus. He wished to turn computer programming into a formal science by strictly defining it....
  • J programming language
  • John Backus
    John Backus

    For the physicist, see John Backus John Warner Backus was an American computer scientist. He led the team that invented the first widely used High-level programming language programming language and was the inventor of the Backus-Naur form , the almost universally used notation to define formal language syntax....