skip to main content
10.1145/1411286.1411300acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
research-article

Making monads first-class with template haskell

Published:25 September 2008Publication History

ABSTRACT

Monads as an organizing principle for programming and semantics are notoriously difficult to grasp, yet they are a central and powerful abstraction in Haskell. This paper introduces a domain-specific language, MonadLab, that simplifies the construction of monads, and describes its implementation in Template Haskell. MonadLab makes monad construction truly first class, meaning that arcane theoretical issues with respect to monad transformers are completely hidden from the programmer. The motivation behind the design of MonadLab is to make monadic programming in Haskell simpler while providing a tool for non-Haskell experts that will assist them in understanding this powerful abstraction.

Skip Supplemental Material Section

Supplemental Material

Video

References

  1. William Harrison and James Hook. Achieving information flow security through monadic control of effects. Invited submission to: Journal of Computer Security, 2008. 46 pages. Accepted for Publication. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Graham Hutton. Programming in Haskell. Cambridge University Press, January 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Pericles Kariotis. Code Repository for MonadLab. June 2008. Available from http://monadgarden.cs.missouri.edu/MonadLab.Google ScholarGoogle Scholar
  4. Sheng Liang. Modular Monadic Semantics and Compilation. PhD thesis, Yale University, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Sheng Liang, Paul Hudak, and Mark Jones. Monad transformers and modular interpreters. In Proceedings of the 22nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL), pages 333--343. ACM Press, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Chuan-Kai Lin. Programming monads operationally with Unimo. In International Conference on Functional Programming ICFP'06, pages 274--285, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Christoph Lüth and Neil Ghani. Composing monads using coproducts. In International Conference on Functional Programming ICFP'02, pages 133--144. ACM Press, September 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Ian Lynagh. Template Haskell: A report from the field. May 2003.Google ScholarGoogle Scholar
  9. Ian Lynagh. Unrolling and simplifying expressions with Template Haskell. May 2003.Google ScholarGoogle Scholar
  10. Nikos S. Papaspyrou. A Resumption Monad Transformer and its Applications in the Semantics of Concurrency. In Proceedings of the 3rd Panhellenic Logic Symposium, 2001. Expanded version available as a tech. report from the author by request.Google ScholarGoogle Scholar
  11. Simon Peyton Jones, Geoffrey Washburn, and Stephanie Weirich. Wobbly types: type inference for generalised algebraic data types. Technical Report MS-CIS-05-26, University of Pennsylvania, Computer and Information Science Department, Levine Hall, 3330 Walnut Street, Philadelphia, Pennsylvania, 19104-6389, July 2004.Google ScholarGoogle Scholar
  12. John Power. Generic models for computational effects. Theoretical Computer Science, 364 (2): 254--269, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Sean Seefried, Manuel Chakravarty, and Gabriele Keller. Optimising Embedded DSLs using Template Haskell. URL: http://www.cse.unsw.edu.au/~sseefried/papers.html, March 2004.Google ScholarGoogle Scholar
  14. Tim Sheard and Simon Peyton Jones. Template metaprogramming for Haskell. In Manuel M. T. Chakravarty, editor, ACM SIGPLAN Haskell Workshop 02, pages 1--16. ACM Press, October 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Tim Sheard and Simon Peyton Jones. Notes on Template Haskell version 2. November 2003.Google ScholarGoogle Scholar
  16. Wouter Swierstra. Data types à la carte. Journal of Functional Programming, 18 (4): 423--436, July 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Walid Taha and Tim Sheard. Metaml and multi-stage programming with explicit annotations. Theoretical Computer Science, 248 (1-2): 211--242, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Phillip Wadler. The essence of functional programming. In Proceedings of the 19th Symposium on Principles of Programming Languages (POPL), pages 1--14. ACM Press, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Phillip Wadler. The expression problem. November 1998. Available from www.daimi.au.dk/~madst/tool/papers/expression.txt.Google ScholarGoogle Scholar
  20. Philip Weaver, Garrin Kimmell, Nicolas Frisby, and Perry Alexander. Modular and generic programming with InterpreterLib. In ASE '07: Proceedings of the twenty-second IEEE/ACM International Conference on Automated Software Engineering, pages 473--476, New York, NY, USA, 2007. ACM. ISBN 978-1-59593-882-4. http://doi.acm.org/10.1145/1321631.1321712. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Making monads first-class with template haskell

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in
    • Published in

      cover image ACM Conferences
      Haskell '08: Proceedings of the first ACM SIGPLAN symposium on Haskell
      September 2008
      134 pages
      ISBN:9781605580647
      DOI:10.1145/1411286
      • Program Chair:
      • Andy Gill
      • cover image ACM SIGPLAN Notices
        ACM SIGPLAN Notices  Volume 44, Issue 2
        HASKELL '08
        February 2009
        126 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/1543134
        Issue’s Table of Contents

      Copyright © 2008 ACM

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 25 September 2008

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article

      Acceptance Rates

      Haskell '08 Paper Acceptance Rate13of28submissions,46%Overall Acceptance Rate57of143submissions,40%

      Upcoming Conference

      ICFP '23

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader
    About Cookies On This Site

    We use cookies to ensure that we give you the best experience on our website.

    Learn more

    Got it!