当前位置: X-MOL 学术arXiv.cs.PL › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
Embedded Pattern Matching
arXiv - CS - Programming Languages Pub Date : 2021-08-30 , DOI: arxiv-2108.13114
Trevor L. McDonell, Joshua D. Meredith, Gabriele Keller

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. In this paper, 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. Our technique enables users to pattern match on terms in the embedded language in much the same way they would in the host language.

中文翻译:

嵌入式模式匹配

Haskell 是托管深度嵌入语言的流行选择。这些嵌入的一个反复出现的挑战是如何无缝集成用户定义的代数数据类型。特别是,用于创建和检查数据的一项重要、方便且富有表现力的功能——模式匹配——不能直接在嵌入式术语中使用。在本文中,我们提出了一种新技术,即嵌入式模式匹配,它能够将用户定义的代数数据类型自然且用户友好地嵌入到嵌入式语言中。我们的技术使用户能够以与在宿主语言中几乎相同的方式对嵌入语言中的术语进行模式匹配。
更新日期:2021-08-31
down
wechat
bug