merl

merl

Module

merl

Module summary

Metaprogramming in Erlang.

Description

Metaprogramming in Erlang. Merl is a more user friendly interface to the erl_syntax module, making it easy both to build new ASTs from scratch and to match and decompose existing ASTs. For details that are outside the scope of Merl itself, please see the documentation of erl_syntax.

Quick start

To enable the full power of Merl, your module needs to include the Merl header file:

-include_lib("syntax_tools/include/merl.hrl").

Then, you can use the ?Q(Text) macros in your code to create ASTs or match on existing ASTs. For example:

Tuple = ?Q("{foo, 42}"),
?Q(