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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Feldspar compiler, http://hackage.haskell.org/package/feldspar-compiler
Feldspar language, http://hackage.haskell.org/package/feldspar-language
Syntactic library, http://hackage.haskell.org/package/syntactic
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)
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)
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)
Elliott, C., Finne, S., de Moor, O.: Compiling embedded languages. Journal of Functional Programming 13(3), 455–481 (2003)
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)
Hughes, J.: Restricted data types in Haskell. In: Proceedings of the 1999 Haskell Workshop (1999)
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
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)
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)
Swierstra, W.: Data types à la carte. Journal of Functional Programming 18(4), 423–436 (2008)
Wadler, P.: The expression problem (1998), http://www.daimi.au.dk/~madst/tool/papers/expression.txt
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
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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)