FP (programming language)

This is an old revision of this page, as edited by Danakil (talk | contribs) at 17:40, 14 August 2004 (Overview). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

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 sequencex1,...,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). One such operation is constant, which transforms a value x into the constant-valued function where:

constant               where    :y = x

for all values y (except the undefined value, , which all functions map into itself, due to their being strict). Next there are the remaining principal functionals of FP:

composition  f&#x°g        where    f&#x°g:x = f:(g:x)
construction [f1,...fn]  where   [f1,...fn]:x =  ⟨f1:x,...,fn:x
condition (hf;g)    where   (hf;g):x   =  f:x   if   h:x  =  T
                       and     (hf;g):x   =  g:x   if   h:x  =  F
                       and     (hf;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⟩⟩