Generic Monadic Constructs for Embedded Languages

  • Anders Persson
  • Emil Axelsson
  • Josef Svenningsson
Part of the Lecture Notes in Computer Science book series (LNCS, 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.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
  2. 2.
  3. 3.
  4. 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)CrossRefGoogle Scholar
  5. 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. 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)CrossRefGoogle Scholar
  7. 7.
    Elliott, C., Finne, S., de Moor, O.: Compiling embedded languages. Journal of Functional Programming 13(3), 455–481 (2003)MATHCrossRefGoogle Scholar
  8. 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. 9.
    Hughes, J.: Restricted data types in Haskell. In: Proceedings of the 1999 Haskell Workshop (1999)Google Scholar
  10. 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 CrossRefGoogle Scholar
  11. 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. 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. 13.
    Swierstra, W.: Data types à la carte. Journal of Functional Programming 18(4), 423–436 (2008)MathSciNetMATHCrossRefGoogle Scholar
  14. 14.
    Wadler, P.: The expression problem (1998), http://www.daimi.au.dk/~madst/tool/papers/expression.txt
  15. 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 CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2012

Authors and Affiliations

  • Anders Persson
    • 1
    • 2
  • Emil Axelsson
    • 1
  • Josef Svenningsson
    • 1
  1. 1.Chalmers University of TechnologySweden
  2. 2.EricssonSweden

Personalised recommendations