Why it's nice to be quoted: quasiquoting for haskell

  • Authors:
  • Geoffrey Mainland

  • Affiliations:
  • Harvard School of Engineering and Applied Sciences, Cambridge, MA

  • Venue:
  • Haskell '07 Proceedings of the ACM SIGPLAN workshop on Haskell workshop
  • Year:
  • 2007

Quantified Score

Hi-index 0.00

Visualization

Abstract

Quasiquoting allows programmers to use domain specific syntax to construct program fragments. By providing concrete syntax for complex data types, programs become easier to read, easier to write, and easier to reason about and maintain. Haskell is an excellent host language for embedded domain specific languages, and quasiquoting ideally complements the language features that make Haskell perform so well in this area. Unfortunately, until now no Haskell compiler has provided support for quasiquoting. We present an implementation in GHC and demonstrate that by leveraging existing compiler capabilities, building a full quasiquoter requires little more work than writing a parser. Furthermore, we provide a compile-time guarantee that all quasiquoted data is type-correct.