Skip to main content

Functional Programming for Domain-Specific Languages

  • Chapter
  • First Online:
Central European Functional Programming School (CEFP 2013)

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

Included in the following conference series:


Domain-specific languages are a popular application area for functional programming; and conversely, functional programming is a popular implementation vehicle for domain-specific languages—at least, for embedded ones. Why is this? The appeal of embedded domain-specific languages is greatly enhanced by the presence of convenient lightweight tools for defining, implementing, and optimising new languages; such tools represent one of functional programming’s strengths. In these lectures we discuss functional programming techniques for embedded domain-specific languages; we focus especially on algebraic datatypes and higher-order functions, and their influence on deep and shallow embeddings.

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

Access this chapter

Subscribe and save

Springer+ Basic
EUR 32.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
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

Institutional subscriptions

Similar content being viewed by others


  1. Fowler, M.: Domain-Specific Languages. Addison-Wesley, Reading (2011)

    Google Scholar 

  2. Mernik, M., Heering, J., Sloane, A.M.: When and how to develop domain-specific languages. ACM Comput. Surv. 37(4), 316–344 (2005)

    Article  Google Scholar 

  3. Bentley, J.: Little languages. Commun. ACM 29(8), 711–721 (1986). Also in ‘More Programming Pearls’ (Addison-Wesley, 1988)

    Article  MathSciNet  Google Scholar 

  4. Boulton, R., Gordon, A., Gordon, M., Harrison, J., Herbert, J., Tassel, J.V.: Experience with embedding hardware description languages in HOL. In: Stavridou, V., Melham, T.F., Boute, R.T. (eds.) Proceedings of the IFIP TC10/WG 10.2 International Conference on Theorem Provers in Circuit Design: Theory, Practice and Experience. Volume A-10 of IFIP Transactions, pp. 129–156. North-Holland/Elsevier, Nijmegen (1992)

    Google Scholar 

  5. Yorgey, B.: Diagrams 0.6 (2012).

  6. Parnas, D.L.: On the criteria to be used in decomposing systems into modules. Commun. ACM 15(12), 1053–1058 (1972)

    Article  Google Scholar 

  7. Wand, M.: Final algebra semantics and data type extensions. J. Comput. Syst. Sci. 19, 27–44 (1979)

    Article  MATH  MathSciNet  Google Scholar 

  8. Kamin, S.: An implementation-oriented semantics of Wadler’s pretty-printing combinators. Oregon Graduate Institute (1998).

  9. Erwig, M., Walkingshaw, E.: Semantics-driven DSL design. In: Mernik, M. (ed.) Formal and Practical Aspects of Domain-Specific Languages: Recent Developments, 56–80. IGI-Global, Hershey (2012)

    Google Scholar 

  10. Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, Reading (1995)

    Google Scholar 

  11. Cook, W.R.: On understanding data abstraction, revisited. In: OOPSLA, pp. 557–572. ACM (2009)

    Google Scholar 

  12. Wadler, P.L.: The expression problem. Posting to java-genericity mailing list (1998)

    Google Scholar 

  13. Hutton, G.: Fold and unfold for program semantics. In: Proceedings of the Third ACM SIGPLAN International Conference on Functional Programming, Baltimore, Maryland, pp. 280–288 (1998)

    Google Scholar 

  14. W3C: Scalable vector graphics (SVG) 1.1: recognized color keyword names (2011).

  15. Henderson, P.: Functional geometry. In: Lisp and Functional Programming, pp. 179–187 (1982).

  16. Henderson, P.: Functional geometry. High. Order Symb. Comput. 15(4), 349–365 (2002). Revision of [15]

    Article  MATH  Google Scholar 

  17. Buß, F.: Functional geometry (2005).

  18. Escher, M.C.: Square limit (1964).

Download references


I am very grateful to the organisers of the Central European Functional Programming Summer School on Domain-Specific Languages in Cluj-Napoca, Romania, for the invitation to speak at the school on the subject of FP and DSLs. My thanks go to the students who provided assistance during the practical sessions: Andrew Bate, Kwok Cheung, Bogdan Panait, and Christopher Rosset. Nick Wu and other members of the Algebra of Programming research group at Oxford made helpful suggestions on the material, and an anonymous reviewer made some suggestions to improve the presentation. This work was partially supported by UK EPSRC grant Reusability and Dependent Types (EP/G034516/1).

Author information

Authors and Affiliations


Corresponding author

Correspondence to Jeremy Gibbons .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2015 Springer International Publishing Switzerland

About this chapter

Cite this chapter

Gibbons, J. (2015). Functional Programming for Domain-Specific Languages. In: Zsók, V., Horváth, Z., Csató, L. (eds) Central European Functional Programming School. CEFP 2013. Lecture Notes in Computer Science(), vol 8606. Springer, Cham.

Download citation

  • DOI:

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-15939-3

  • Online ISBN: 978-3-319-15940-9

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics