skip to main content
research-article

Simple and compositional reification of monadic embedded languages

Published:25 September 2013Publication History
Skip Abstract Section

Abstract

When writing embedded domain specific languages in Haskell, it is often convenient to be able to make an instance of the Monad class to take advantage of the do-notation and the extensive monad libraries. Commonly it is desirable to compile such languages rather than just interpret them. This introduces the problem of monad reification, i.e. observing the structure of the monadic computation. We present a solution to the monad reification problem and illustrate it with a small robot control language. Monad reification is not new but the novelty of our approach is in its directness, simplicity and compositionality.

References

  1. E. Axelsson. Syntactic. http://hackage.haskell.org/package/syntactic.Google ScholarGoogle Scholar
  2. E. Axelsson. A generic abstract syntax model for embedded languages. In Proceedings of the 17th ACM SIGPLAN international conference on Functional programming, pages 323--334. ACM, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. P. Bahr and T. Hvitved. Parametric compositional data types. In MSFP, pages 3--24, 2012.Google ScholarGoogle ScholarCross RefCross Ref
  4. K. Claessen, M. Sheeran, and B. J. Svensson. Expressive Array Constructs in an Embedded GPU Kernel Programming Language. In Proceedings of the 7th workshop on Declarative aspects and applications of multicore programming, DAMP '12, pages 21--30, New York, NY, USA, 2012. ACM. ISBN 978-1-4503-1117-5. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. A. Farmer and A. Gill. Haskell DSLs for interactive web services. In 1st International Workshop on Cross-model Language Design and Implementation, Sep 2012. (published on workshop website, http://workshops.inf.ed.ac.uk/xldi2012/).Google ScholarGoogle Scholar
  6. P. Hudak. The Haskell School of Expression: Learning Functional Programming through Multimedia. Cambridge University Press, New York, NY, USA, 1999. ISBN 0521643384. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. A. Persson, E. Axelsson, and J. Svenningsson. Generic monadic constructs for embedded languages. In Proceedings of the 23rd international conference on Implementation and Application of Functional Languages, IFL'11, pages 85--99, Berlin, Heidelberg, 2012. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. N. Sculthorpe, J. Bracker, G. Giorgidze, and A. Gill. The constrained-monad problem. In Proceedings of the 18th ACM SIGPLAN international conference on Functional programming. ACM, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. W. Swierstra. Data types à la carte. Journal of Functional Programming, 18 (4): 423, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Simple and compositional reification of monadic embedded languages

      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

      Full Access

      • Published in

        cover image ACM SIGPLAN Notices
        ACM SIGPLAN Notices  Volume 48, Issue 9
        ICFP '13
        September 2013
        457 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/2544174
        Issue’s Table of Contents
        • cover image ACM Conferences
          ICFP '13: Proceedings of the 18th ACM SIGPLAN international conference on Functional programming
          September 2013
          484 pages
          ISBN:9781450323260
          DOI:10.1145/2500365

        Copyright © 2013 ACM

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 25 September 2013

        Check for updates

        Qualifiers

        • research-article

      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!