diff --git a/doc/manual/expressions/language-constructs.xml b/doc/manual/expressions/language-constructs.xml index 74809bb41..7535e64ea 100644 --- a/doc/manual/expressions/language-constructs.xml +++ b/doc/manual/expressions/language-constructs.xml @@ -177,13 +177,19 @@ map (concat "foo") [ "bar" "bla" "abc" ] An @-pattern provides a means of referring to the whole value being matched: - -args@{ x, y, z, ... }: z + y + x + args.a + args@{ x, y, z, ... }: z + y + x + args.a + +but can also be written as: + + { x, y, z, ... } @ args: z + y + x + args.a Here args is bound to the entire argument, which is further matched against the pattern { x, y, z, - ... }. - + ... }. @-pattern makes mainly sense with an + ellipsis(...) as you can access attribute names as + a, using args.a, which was given as an + additional attribute to the function. + @@ -359,4 +365,4 @@ character, or inline/multi-line, enclosed within /* - \ No newline at end of file +