Skip to content

Commit 11379cf

Browse files
committed
More cleanup from allowing (...Front, Last)
1 parent 3d6984e commit 11379cf

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

text/0000-variadic-generics.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
This RFC proposes the addition of several features to support variadic generics:
1010
- An intrinsic `Tuple` trait implemented exclusively by tuples
11-
- `(Head, ...Tail)` syntax for tuple types where `Tail: Tuple`
11+
- `...T` syntax for tuple types where `T: Tuple`
1212
- `let (head, ...tail) = tuple;` pattern-matching syntax for tuples
1313
- `let tuple = (head, ...tail);` syntax for joining an element with a tuple
1414

@@ -142,9 +142,10 @@ patterns for working with `Cons`-cell based lists. Rustaceans coming from
142142
other functional programming languages will likely be familiar with the concept
143143
of recursively-defined lists. For those unfamiliar with `Cons`-based
144144
lists, the concept should be introduced using "structural recursion": there's
145-
a base case, `()`, and a recursive/inductive case: `(Head, ...Tail)`. Any tuple
146-
can be thought of in this way
147-
(for example, `(A, B, C)` is equivalent to `(A, ...(B, ...(C, ...())))`).
145+
a base case, `()`, and a recursive/inductive case: `(Head, ...Tail)` or
146+
`(Front..., Last)`. Any tuple can be thought of in this way
147+
(for example, `(A, B, C)` is equivalent to `(A, ...(B, ...(C, ...())))`
148+
and `(A, ...(B, ...(C, ...())))`).
148149

149150
When teaching this new syntax, it is important to note that the proposed system
150151
allows for more complicated matching than traditional `Cons`-lists. For example,

0 commit comments

Comments
 (0)