Is it possible to roll your own syntax sugar (like do-notation, or arrow-notation) in Haskell? -


Well, the question is self-prudish. Suppose I want to implement some special syntax for fun. Is this possible? What equipment should I use? There is no such meta-syntax in the Haskell standard, but in GHC you can use GHC "semi-syntax" Quotes "features (which are different from the GHC's" Template Haskell "feature) and create almost any notation.

This is quite low, and mainly for both Viki and Implementer, both of these points for original publication:

People have used quasi-quotes to embed XML syntax, regular expressions, special string and text forms, and "JMacro is a library for programmatic generation of JavaScript code."

Comments

Popular posts from this blog

qt - switch/case statement in C++ with a QString type -

python - sqlite3.OperationalError: near "REFERENCES": syntax error - foreign key creating -

Python's equivalent for Ruby's define_method? -