Skip to content

Research at St Andrews

Programming and reasoning with algebraic effects and dependent types

Research output: Chapter in Book/Report/Conference proceedingConference contribution

DOI

Author(s)

School/Research organisations

Abstract

One often cited benefit of pure functional programming is that pure code is
easier to test and reason about, both formally and informally. However,
real programs have side-effects including state management, exceptions and
interactions with the outside world.
Haskell solves this problem using monads to capture
details of possibly side-effecting computations --- it provides monads for
capturing state, I/O, exceptions, non-determinism, libraries for practical
purposes such as CGI and parsing, and many others, as well as monad
transformers for combining multiple effects.

Unfortunately, useful as monads are, they do not compose very well. Monad
transformers can quickly become unwieldy when there are lots of effects to
manage, leading to a temptation in larger programs to combine everything into
one coarse-grained state and exception monad. In this paper I describe an
alternative approach based on handling algebraic effects, implemented
in the Idris programming language. I show how to describe side effecting
computations, how to write programs which compose multiple fine-grained
effects, and how, using dependent types, we can use this approach to reason
about states in effectful programs.
Close

Details

Original languageEnglish
Title of host publicationICFP '13
Subtitle of host publicationProceedings of the 18th ACM SIGPLAN international conference on Functional programming
Place of PublicationNew York
PublisherACM
Pages133-144
ISBN (Print)978-1-4503-2326-0
DOIs
StatePublished - 2013

    Research areas

  • Dependent Types, Algebraic Effects

Discover related content
Find related publications, people, projects and more using interactive charts.

View graph of relations

Related by author

  1. Type driven development of concurrent communicating systems

    Brady, E. C. 7 Jul 2017 In : Computer Science. 18, 3, 22 p., 1413

    Research output: Contribution to journalArticle

  2. Sequential decision problems, dependent types and generic solutions

    Botta, N., Jansson, P., Ionescu, C., Christiansen, D. & Brady, E. C. 17 Mar 2017 In : Logical Methods in Computer Science. 13, 1, 23 p., 7

    Research output: Contribution to journalArticle

  3. Type-driven development with Idris

    Brady, E. C. Mar 2017 Shelter Island: Manning Publications Co.480 p.

    Research output: Book/ReportBook

  4. Automatically proving equivalence by type-safe reflection

    Slama, F. & Brady, E. C. 2017 Intelligent Computer Mathematics: 10th International Conference, CICM 2017, Edinburgh, UK, July 17-21, 2017, Proceedings. Geuvers, H., England, M., Hasan, O., Rabe, F. & Teschke, O. (eds.). Cham: Springer, p. 40-55 (Lecture Notes in Computer Science (Lecture Notes in Artificial Intelligence); vol. 10383)

    Research output: Chapter in Book/Report/Conference proceedingConference contribution

  5. Elaborator reflection: extending Idris in Idris

    Christiansen, D. & Brady, E. C. 4 Sep 2016 Proceedings of the 21st ACM SIGPLAN International Conference on Functional Programming. New York: ACM, p. 284-297

    Research output: Chapter in Book/Report/Conference proceedingConference contribution

ID: 61401371