Embedded Pattern Matching (Video, Haskell 2022)
Trevor L. McDonell, Joshua D. Meredith, and Gabriele Keller
(Utrecht University, Netherlands; IOG, Australia; Utrecht University, Netherlands)
Abstract: Haskell is a popular choice for hosting deeply embedded languages. A recurring challenge for these embeddings is how to seamlessly integrate user defined algebraic data types. In particular, one important, convenient, and expressive feature for creating and inspecting data—pattern matching—is not directly available on embedded terms. We present a novel technique, embedded pattern matching, which enables a natural and user friendly embedding of user defined algebraic data types into the embedded language, and allows programmers to pattern match on terms in the embedded language in much the same way they would in the host language.
Article: https://doi.org/10.1145/3546189.3549917
Supplementary archive: https://doi.org/10.1145/3554299 (Badges: Artifacts Available)
Supplementary web page: https://github.com/tmcdonell/embedded...
ORCID: https://orcid.org/0000-0001-7806-9751, https://orcid.org/0000-0003-0797-4329, https://orcid.org/0000-0003-1442-5387
Video Tags: Haskell, pattern matching, algebraic data types, embedded languages, icfpws22haskellmain-p33-p, doi:10.1145/3546189.3549917, doi:10.1145/3554299, orcid:0000-0001-7806-9751, orcid:0000-0003-0797-4329, orcid:0000-0003-1442-5387, Artifacts Available
Presentation at the Haskell 2022 conference, September 15–16, 2022, https://icfp22.sigplan.org/home/haske...
Sponsored by ACM, ACM SIGPLAN, https://www.sigplan.org/