Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/143165.143169acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
Article
Free access

The essence of functional programming

Published: 01 February 1992 Publication History
  • Get Citation Alerts
  • Abstract

    This paper explores the use monads to structure functional programs. No prior knowledge of monads or category theory is required.
    Monads increase the ease with which programs may be modified. They can mimic the effect of impure features such as exceptions, state, and continuations; and also provide effects not easily achieved with such features. The types of a program reflect which effects occur.
    The first section is an extended example of the use of monads. A simple interpreter is modified to support various extra features: error messages, state, output, and non-deterministic choice. The second section describes the relation between monads and the continuation-passing style. The third section sketches how monads are used in a compiler for Haskell that is written in Haskell.

    References

    [1]
    A. Appel and T. Jim, Continuation-passing, closure-passing style. In 16'th Symposium on Principles of Programming Languages, Austin, Texas; ACM, January 1989.
    [2]
    R. Bird and P. Wadler, Introduction to Functional Programming. Prentice Hall, 1987.
    [3]
    O. Danvy and A. Filinski, Abstracting control. In Conference on Lisp and Functional Programming, Nice, France; ACM, June 1990.
    [4]
    B. Duba, R. Harper, and D. MacQueen, Typing first-class continuations in ML. In 18'th Symposium on Principles of Programming Languages, Orlando, Florida; ACM, January 1991.
    [5]
    J. Guzmgn and e. Hudak, Single-threaded polymorphic lambda calculus. In Symposium on Logic in Computer Science, Philadelphia, Pennsylvania; IEEE, June 1990.
    [6]
    D.K. Gifford and J. M. Lucassen, Integrating functional and imperative programming. In Conference on Lisp and Functional Programming, 28-39, Cambridge, Massachusetts; ACM, August 1986.
    [7]
    P. Hancock, A type checker. Chapter 9 of Simon Peyton Jones, The Implementation of Functional Programming Languages, Prentice Hall, 1987.
    [8]
    P. Hudak, S. Peyton Jones and P. Wadler, editors, Report on the Programming Language Haskell: Version 1.1. Technical report, Yale University and Glasgow University, August 1991.
    [9]
    P. Jouvelot and D. Gifford, Algebraic reconstruction of types and effects. In 18'th A CM Symposium on Principles of Programming Languages, Orlando, Florida, January 1991.
    [10]
    J. Lambek and P. Scott, Introduction to Higher Order Categorical Logic, Cambridge University Press, 1986.
    [11]
    S. Mac Lane, Categories for the Working athematician, Springer-Verlag, 1971.
    [12]
    E. Moggi, Computational lamb da- calculus and monads. In Symposium on Logic in Computer Science, Asilomar, California; IEEE, June 1989. (A longer version is available as a technical report from the University of Edinburgh.)
    [13]
    E. Moggi, An abstract view of programming languges. Course notes, University of Edinburgh.
    [14]
    R. Milner, M. Tofte, and R. Harper, The definition of Standard ML. MIT Press, 1990.
    [15]
    L. C. Paulson, ML for the Working Programmer. Cambridge University Press, 1991.
    [16]
    N. Perry, Hope+C, a continuation extension for Hope+. Imperial College, Department of Computing, Technical report IC/FPR/LANG/2.5.1/21, November 1987.
    [17]
    G. Plotkin, Call-by-name, call-by-value, and the )i-calculus. Theoretical Computer Science, 1:125-159, 1975.
    [18]
    J. Rees and W. Clinger (eds.), The revised3 report on the algorithmic language Scheme. ACM SIGPLAN Notices, 21(12):37-79, 1986.
    [19]
    J. Reynolds, Definitional interpreters for higher-order programming languages. In 25'th ACM National Conference, 717-740, 1972.
    [20]
    J. Reynolds, Using category theory to design implicit conversion and generic opin N. Jones, editor, Semantics- Directed Compiler Generation, 211-258, Berlin; LNCS 94, Springer-Verlag, 1980.
    [21]
    J. Reynolds, The essence of Algol. In de Bakker and van Vliet, editors, Algorithmic Languages, 345-372, North Holland, 1981.
    [22]
    J. Reynolds, Preliminary design of the programming language Forsythe. Carnegie Mellon University technical report CMU- CS-88-159, June 1988.
    [23]
    J. C. Reynolds, Syntactic control of interference, part II. In International Colloquium on Automata, Languages, and Programming, 1989.
    [24]
    J. Reynolds, The coherrence of languages with intersection types. In International Conference on Theoretical Aspects of Computer Software, Sendai, Japan, LNCS, Springer Verlag, September 1991.
    [25]
    M. Spivey, A functional theory of exceptions. Science of Computer Programming, 14(1):25-42, June 1990.
    [26]
    V. Swarup, U. S. Reddy, and E. Ireland, Assignments for applicative languages. In Conference on Functional Programm~ng Languages and Computer Architecture, Cambridge, Massachusetts; LNCS 523, Springer Verlag, August 1991.
    [27]
    G.L. Steele, Jr. and G. Sussman, Lambda, the ultimate imperative. MIT, AI Memo 353, March 1976.
    [28]
    D.A. Turner, An overview of Miranda. In D. A. Turner, editor, Research Topics in Functional Programming. Addison Wesley, 1990.
    [29]
    P. Wadler, How to replace failure by a list of successes. Conference on Functional Programming Languages and Computer Architecture, Nancy, France; LNCS 201, Springer-Verlag, September 1985.
    [30]
    P. WadIer, Comprehending monads. In Conference on Lisp and Functional Programming, Nice, France; ACM, June 1990.
    [31]
    Is there a use for linear logic? Conference on Partial Evaluation and Semantics- Based Program Manipulation (PEPM), New Haven, Connecticut; ACM, June 1991.

    Cited By

    View all
    • (2024)Lightweight DSL for Describing Extensible Transition SystemsProceedings of the 39th ACM/SIGAPP Symposium on Applied Computing10.1145/3605098.3636025(1122-1131)Online publication date: 8-Apr-2024
    • (2024)Signature restriction for polymorphic algebraic effectsJournal of Functional Programming10.1017/S095679682400005434Online publication date: 27-May-2024
    • (2024)ChatGPT Prompt Patterns for Improving Code Quality, Refactoring, Requirements Elicitation, and Software DesignGenerative AI for Effective Software Development10.1007/978-3-031-55642-5_4(71-108)Online publication date: 1-Jun-2024
    • Show More Cited By

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    POPL '92: Proceedings of the 19th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
    February 1992
    376 pages
    ISBN:0897914538
    DOI:10.1145/143165
    • Chairman:
    • Ravi Sethi
    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

    Sponsors

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 01 February 1992

    Permissions

    Request permissions for this article.

    Check for updates

    Qualifiers

    • Article

    Conference

    POPL92
    POPL92: 19th ACM Symposium on Principles of Programming Languages
    January 19 - 22, 1992
    New Mexico, Albuquerque, USA

    Acceptance Rates

    POPL '92 Paper Acceptance Rate 30 of 204 submissions, 15%;
    Overall Acceptance Rate 824 of 4,130 submissions, 20%

    Upcoming Conference

    POPL '25

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)1,284
    • Downloads (Last 6 weeks)95
    Reflects downloads up to 11 Aug 2024

    Other Metrics

    Citations

    Cited By

    View all
    • (2024)Lightweight DSL for Describing Extensible Transition SystemsProceedings of the 39th ACM/SIGAPP Symposium on Applied Computing10.1145/3605098.3636025(1122-1131)Online publication date: 8-Apr-2024
    • (2024)Signature restriction for polymorphic algebraic effectsJournal of Functional Programming10.1017/S095679682400005434Online publication date: 27-May-2024
    • (2024)ChatGPT Prompt Patterns for Improving Code Quality, Refactoring, Requirements Elicitation, and Software DesignGenerative AI for Effective Software Development10.1007/978-3-031-55642-5_4(71-108)Online publication date: 1-Jun-2024
    • (2023)Flexible Instruction-Set Semantics via Abstract Monads (Experience Report)Proceedings of the ACM on Programming Languages10.1145/36078337:ICFP(108-124)Online publication date: 31-Aug-2023
    • (2023)Hefty Algebras: Modular Elaboration of Higher-Order Algebraic EffectsProceedings of the ACM on Programming Languages10.1145/35712557:POPL(1801-1831)Online publication date: 11-Jan-2023
    • (2023)From semantics to types: The case of the imperative λ-calculusTheoretical Computer Science10.1016/j.tcs.2023.114082973(114082)Online publication date: Sep-2023
    • (2022)On Structuring Functional Programs with Monoidal ProfunctorsElectronic Proceedings in Theoretical Computer Science10.4204/EPTCS.360.7360(134-150)Online publication date: 30-Jun-2022
    • (2022)A Faithful Description of ECMAScript AlgorithmsProceedings of the 24th International Symposium on Principles and Practice of Declarative Programming10.1145/3551357.3551381(1-14)Online publication date: 20-Sep-2022
    • (2022)Containerless Plurals: Separating Number from Type in Object-Oriented ProgrammingACM Transactions on Programming Languages and Systems10.1145/352763544:4(1-56)Online publication date: 21-Sep-2022
    • (2022)Programming Autonomous Machines : Special Session Paper2022 International Conference on Embedded Software (EMSOFT)10.1109/EMSOFT55006.2022.00018(24-33)Online publication date: Oct-2022
    • Show More Cited By

    View Options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Get Access

    Login options

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media