In the Macro
module source code we can see that an AST (input of a macro) is:
@typedoc "Abstract Syntax Tree (AST)"
@type t :: input
@typedoc "The inputs of a macro"
@type input ::
input_expr
| {input, input}
| [input]
| atom
| number
| binary
@typep input_expr :: {input_expr | atom, metadata, atom | [input]}
Why is the input_expr
type private instead of being public as I imagine it would be ? The same could be asked for output_expr
. Does that mean that we are not supposed to parse ASTs directly but have to rely on functions provided by the Macro
module like traverse
and co ? I find it surprising because the types belong to the API i.e. input()
is public but input_expr()
is not.