Skip to main content

Generic Monadic Constructs for Embedded Languages

  • Conference paper

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 7257))

Abstract

We present a library of generic monadic constructs for embedded languages. It is an extension of Syntactic, a Haskell library for defining and processing generic abstract syntax. Until now, Syntactic has been mostly suited to implement languages based on pure, side effect free, expressions. The presented extension allows the pure expressions to also contain controlled side effects, enabling the representation of expressions that rely on destructive updates for efficiency. We demonstrate the usefulness of the extension by giving examples from the embedded language Feldspar which is implemented using Syntactic.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   54.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   72.00
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Feldspar compiler, http://hackage.haskell.org/package/feldspar-compiler

  2. Feldspar language, http://hackage.haskell.org/package/feldspar-language

  3. Syntactic library, http://hackage.haskell.org/package/syntactic

  4. Axelsson, E., Claessen, K., Sheeran, M., Svenningsson, J., Engdal, D., Persson, A.: The Design and Implementation of Feldspar – an Embedded Language for Digital Signal Processing. In: Hage, J., Morazán, M.T. (eds.) IFL. LNCS, vol. 6647, pp. 121–136. Springer, Heidelberg (2011)

    Chapter  Google Scholar 

  5. Axelsson, E., Dévai, G., Horváth, Z., Keijzer, K., Lyckegård, B., Persson, A., Sheeran, M., Svenningsson, J., Vajda, A.: Feldspar: A Domain Specific Language for Digital Signal Processing algorithms. In: Proc. Eighth ACM/IEEE International Conference on Formal Methods and Models for Codesign, MemoCode. IEEE Computer Society (2010)

    Google Scholar 

  6. Axelsson, E., Sheeran, M.: Feldspar: Application and Implementation. In: Zsók, V., Horváth, Z., Plasmeijer, R. (eds.) CEFP 2012. LNCS, vol. 7241, pp. 402–439. Springer, Heidelberg (2012)

    Chapter  Google Scholar 

  7. Elliott, C., Finne, S., de Moor, O.: Compiling embedded languages. Journal of Functional Programming 13(3), 455–481 (2003)

    Article  MATH  Google Scholar 

  8. Hudak, P.: Modular domain specific languages and tools. In: ICSR 1998: Proceedings of the 5th International Conference on Software Reuse, p. 134. IEEE Computer Society, Washington, DC (1998)

    Google Scholar 

  9. Hughes, J.: Restricted data types in Haskell. In: Proceedings of the 1999 Haskell Workshop (1999)

    Google Scholar 

  10. Marlow, S., Newton, R., Peyton Jones, S.: A monad for deterministic parallelism. In: Proceedings of the 4th ACM Symposium on Haskell, Haskell 2011, pp. 71–82. ACM, New York (2011), http://doi.acm.org/10.1145/2034675.2034685

    Chapter  Google Scholar 

  11. Pfenning, F., Elliott, C.: Higher-order abstract syntax. In: Proceedings of the ACM SIGPLAN 1988 Conference on Programming Language Design and Implementation, PLDI 1988, pp. 199–208. ACM (1988)

    Google Scholar 

  12. Schrijvers, T., Peyton Jones, S., Sulzmann, M., Vytiniotis, D.: Complete and decidable type inference for GADTs. In: Proc. 14th ACM SIGPLAN International Conference on Functional Programming, pp. 341–352. ACM (2009)

    Google Scholar 

  13. Swierstra, W.: Data types à la carte. Journal of Functional Programming 18(4), 423–436 (2008)

    Article  MathSciNet  MATH  Google Scholar 

  14. Wadler, P.: The expression problem (1998), http://www.daimi.au.dk/~madst/tool/papers/expression.txt

  15. Wadler, P.: Comprehending monads. In: Proceedings of the 1990 ACM Conference on LISP and Functional Programming, LFP 1990, pp. 61–78. ACM, New York (1990), http://doi.acm.org/10.1145/91556.91592

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2012 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Persson, A., Axelsson, E., Svenningsson, J. (2012). Generic Monadic Constructs for Embedded Languages. In: Gill, A., Hage, J. (eds) Implementation and Application of Functional Languages. IFL 2011. Lecture Notes in Computer Science, vol 7257. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-34407-7_6

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-34407-7_6

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-34406-0

  • Online ISBN: 978-3-642-34407-7

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics