efe4b690ae
functions that take a single argument (plain lambdas) into one AST node (Function) that contains a Pattern node describing the arguments. Current patterns are single lazy arguments (VarPat) and matching against an attribute set (AttrsPat). This refactoring allows other kinds of patterns to be added easily, such as Haskell-style @-patterns, or list pattern matching.
31 lines
605 B
XML
31 lines
605 B
XML
<?xml version='1.0' encoding='utf-8'?>
|
|
<expr>
|
|
<attrs>
|
|
<attr name="a">
|
|
<string value="foo" />
|
|
</attr>
|
|
<attr name="b">
|
|
<string value="bar" />
|
|
</attr>
|
|
<attr name="c">
|
|
<string value="foobar" />
|
|
</attr>
|
|
<attr name="f">
|
|
<function>
|
|
<attrspat>
|
|
<attr name="z" />
|
|
<attr name="x" />
|
|
<attr name="y" />
|
|
</attrspat>
|
|
</function>
|
|
</attr>
|
|
<attr name="id">
|
|
<function>
|
|
<varpat name="x" />
|
|
</function>
|
|
</attr>
|
|
<attr name="x">
|
|
<int value="123" />
|
|
</attr>
|
|
</attrs>
|
|
</expr>
|