Folding Domain−Specific Languages: Deep and Shallow Embeddings
Jeremy Gibbons and Nicolas Wu
A domain-specific language can be implemented by embedding within a general-purpose host language. This embedding may be deep or shallow, depending on whether terms in the language construct syntactic or semantic representations. The deep and shallow styles are closely related, and intimately connected to folds; in this paper, we explore that connection.