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.
- E. Axelsson. Syntactic. http://hackage.haskell.org/package/syntactic.Google Scholar
- 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 Scholar
Digital Library
- P. Bahr and T. Hvitved. Parametric compositional data types. In MSFP, pages 3--24, 2012.Google Scholar
Cross Ref
- 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 Scholar
Digital Library
- 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 Scholar
- P. Hudak. The Haskell School of Expression: Learning Functional Programming through Multimedia. Cambridge University Press, New York, NY, USA, 1999. ISBN 0521643384. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- W. Swierstra. Data types à la carte. Journal of Functional Programming, 18 (4): 423, 2008. Google Scholar
Digital Library
Index Terms
Simple and compositional reification of monadic embedded languages
Recommendations
Simple and compositional reification of monadic embedded languages
ICFP '13: Proceedings of the 18th ACM SIGPLAN international conference on Functional programmingWhen 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 ...
Compiling Embedded Programs to Byte Code
PADL '02: Proceedings of the 4th International Symposium on Practical Aspects of Declarative LanguagesFunctional languages have proven substantially useful for hosting embedded domain-specific languages. They provide an infrastructure rich enough to define both a convenient syntax for the embedded language, a type system for embedded programs, and an ...
Everything old is new again: quoted domain-specific languages
PEPM '16: Proceedings of the 2016 ACM SIGPLAN Workshop on Partial Evaluation and Program ManipulationWe describe a new approach to implementing Domain-Specific Languages(DSLs), called Quoted DSLs (QDSLs), that is inspired by two old ideas:quasi-quotation, from McCarthy's Lisp of 1960, and the subformula principle of normal proofs, from Gentzen's ...







Comments