Total functional programming

Total functional programming

Total functional programming (also known as strong functional programming [This term is due to: Citation|last1=Turner|first1=D.A.|author-link=David Turner (computer scientist)|contribution=Elementary Strong Functional Programming|title=First International Symposium on Functional Programming Languages in Education|date=December 1995|journal=Springer LNCS|volume=1022|page=1–13.] , to be contrasted with ordinary, or "weak" functional programming) is a programming paradigm which restricts the range of programs to those which are provably terminating.

Termination is guaranteed through a restricted form of recursion, which operates only upon ‘reduced’ forms of its arguments. One such form is Walther recursion. In addition, every function must be a total (as opposed to partial) function. That is, it must have a definition for everything inside its domain. This may lead to unexpected or arbitrary definitions such as forall x subset mathbb{N}. x div 0 = 0

These restrictions mean that total functional programming is not Turing-complete. However, the set of algorithms which can be used is still huge. For example, any algorithm which has had an asymptotic upper bound calculated for it can be trivially transformed into a provably-terminating function by using the upper bound as an extra argument which is decremented upon each iteration or recursion.

Another outcome of total functional programming is that there is no longer a separation between strict evaluation and lazy evaluation.

Total functional programming must necessarily also make a distinction between data and codata—the former is finitary, which the latter is potentially infinite. Such potentially infinite data structures are needed for applications such as I/O. Using codata entails the usage of such operations as corecursion.

Both Epigram and Charity could be considered total functional programming languages, even though they don't work in the way Turner specifies in his paper. So could programming directly in plain System F, in Martin-Löf type theory or the Calculus of Constructions.

Footnotes

References

*


Wikimedia Foundation. 2010.

Игры ⚽ Нужно сделать НИР?

Look at other dictionaries:

  • Comparison of programming paradigms — Programming paradigms Agent oriented Automata based Component based Flow based Pipelined Concatenative Concurrent computin …   Wikipedia

  • Computer programming — Programming redirects here. For other uses, see Programming (disambiguation). Software development process Activities and steps …   Wikipedia

  • Total Gym — The Total Gym is a brand name and product line of exercise machines used for strength training, stretching, and pilates training designed by EFI Sports Medicine Incorporated of San Diego, California. The various models are manufactured for 3… …   Wikipedia

  • Euphoria (programming language) — Euphoria openEuphoria logo Paradigm(s) Imperative, procedural Appeared in 1993 Designed by Jeremy Cowgar, Robert Craig (original), Matt Lewis, Derek Parnell …   Wikipedia

  • Dynamic programming — For the programming paradigm, see Dynamic programming language. In mathematics and computer science, dynamic programming is a method for solving complex problems by breaking them down into simpler subproblems. It is applicable to problems… …   Wikipedia

  • computer programming language — Introduction       any of various languages for expressing a set of detailed instructions for a digital computer. Such instructions can be executed directly when they are in the computer manufacturer specific numerical form known as machine… …   Universalium

  • Extreme Programming Practices — Extreme Programming (XP) is a popular agile software development methodology used to implement software projects. This article details the practices used in this methodology. Extreme Programming has 12 practices, grouped into four areas, derived… …   Wikipedia

  • Applicative programming language — In the classification of programming languages, an applicative programming language is designed to support the development of programs as giving the result of a function of the combined variables. Successive functional transformations are applied …   Wikipedia

  • Pascal (programming language) — Pascal Paradigm(s) imperative, structured Appeared in 1970 Designed by Niklaus Wirth Typing discipline static, strong, safe …   Wikipedia

  • Class (computer programming) — In object oriented programming, a class is a construct that is used as a blueprint to create instances of itself – referred to as class instances, class objects, instance objects or simply objects. A class defines constituent members which enable …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”