Hostname: page-component-586b7cd67f-dlnhk Total loading time: 0 Render date: 2024-11-22T16:59:46.676Z Has data issue: false hasContentIssue false

What is a purely functional language?

Published online by Cambridge University Press:  01 January 1998

AMR SABRY
Affiliation:
Department of Computer and Information Science, University of Oregon, Eugene, OR 97403, USA (e-mail: [email protected])
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

Functional programming languages are informally classified into pure and impure languages. The precise meaning of this distinction has been a matter of controversy. We therefore investigate a formal definition of purity. We begin by showing that some proposed definitions which rely on confluence, soundness of the beta axiom, preservation of pure observational equivalences and independence of the order of evaluation, do not withstand close scrutiny. We propose instead a definition based on parameter-passing independence. Intuitively, the definition implies that functions are pure mappings from arguments to results; the operational decision of how to pass the arguments is irrelevant. In the context of Haskell, our definition is consistent with the fact that the traditional call-by-name denotational semantics coincides with the traditional call-by-need implementation. Furthermore, our definition is compatible with the stream-based, continuation-based and monad-based integration of computational effects in Haskell. Finally, we observe that call-by-name reasoning principles are unsound in compilers for monadic Haskell.

Type
Research Article
Copyright
© 1998 Cambridge University Press
Submit a response

Discussions

No Discussions have been published for this article.