form() = erl_parse:abstract_form()
forms() = [form()]
mapf() = fun((form()) -> any())
mrf() = fun((form(), any()) -> {any(), any()})
opt() = forms_only
opts() = [opt()]
predicate() = fun((form()) -> boolean())
redf() = fun((form(), any()) -> any())
all/2 | Check if all forms meet the provided predicate. |
any/2 | Check if there is any form meeting the provided predicate. |
cons_to_list/1 | Convert a cons (abstract representation of a list) into a list. |
eval/1 | Evaluate the provided String expression or abstract form. |
filter/2 | Filter out all forms not meeting the provided predicate. |
from_abstract/1 | Turn the provided abstract form into an Erlang representation. |
list_to_cons/1 | Convert a list into a cons (abstract representation of a list). |
map/2 | Calls the provided fun/1 on all given forms, including nested forms. |
map/3 | |
mr/3 | Combines the operations of map/2 and reduce/3 into one pass. |
quote/1 | Quote a form so that it can, for instance, be bound to a variable when manipulating Erlang's abstract code. |
read/1 | Read the Erlang abstract forms from the specified source file or binary compiled using the -debug_info compile option. |
reduce/3 | Calls the provided fun/2 on all given forms, including nested forms. |
reduce/4 | |
to_abstract/1 | Turn the provided Erlang attribute or expression into its abstract format representation. |
unquote/1 | Inverse of the quote/1 function. |
all(Pred::predicate(), Fs::forms()) -> boolean()
Check if all forms meet the provided predicate.
any(Pred::predicate(), Fs::forms()) -> boolean()
Check if there is any form meeting the provided predicate.
cons_to_list(Cons::form()) -> list()
Convert a cons (abstract representation of a list) into a list
eval(Expr::string() | form()) -> term()
Evaluate the provided String expression or abstract form.
filter(Fun::predicate(), Forms::forms()) -> forms()
Filter out all forms not meeting the provided predicate.
from_abstract(Forms::form()) -> string()
Turn the provided abstract form into an Erlang representation.
list_to_cons(Tail::list()) -> form()
Convert a list into a cons (abstract representation of a list)
Calls the provided fun/1 on all given forms, including nested forms. The original forms are replaced by the resulting Erlang term after applying the provided fun/1 on them.
Combines the operations of map/2 and reduce/3 into one pass.
quote(Term) -> any()
Quote a form so that it can, for instance, be bound to a variable when manipulating Erlang's abstract code.
The following abstract code is not valid code{match, 1, {var, 1, 'A'}, {function, 1, foo, 0, [ {clause, 0, [], [], [{atom, 1, foo}]} ]}}
because, in Erlang code, it would be equivalent to
A = foo() -> foo.
which is, obviously, no valid Erlang code. However, one could quote the right-hand side of the above match operation so that it becomes a valid Erlang expression.
One could consider that an expression similar to the one below
{match, 1, {var, 1, 'A'}, forms:quote( {function, 1, foo, 0, [ {clause, 0, [], [], [{atom, 1, foo}]} ]})}
becomes something like
A = <<...>>.
read(Module::atom() | iolist()) -> forms()
Read the Erlang abstract forms from the specified source file or binary compiled using the -debug_info compile option.
Calls the provided fun/2 on all given forms, including nested forms. fun/2 must return a new accumulator which is passed to the next call.
to_abstract(String::string()) -> form()
Turn the provided Erlang attribute or expression into its abstract format representation.
unquote(Binary) -> any()
Inverse of the quote/1 function. Takes a quoted form and returns its original form.
Generated by EDoc