Skip to content

Commit 55fbf10

Browse files
authored
extractor-objects.md: Option[Seq[T]] is useful when the number of values isn't fixed
1 parent 38cd45e commit 55fbf10

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

_tour/extractor-objects.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,4 @@ The return type of an `unapply` should be chosen as follows:
5757
* If it returns a single sub-value of type T, return an `Option[T]`
5858
* If you want to return several sub-values `T1,...,Tn`, group them in an optional tuple `Option[(T1,...,Tn)]`.
5959

60-
Sometimes, the number of sub-values is fixed and we would like to return a sequence. For this reason, you can also define patterns through `unapplySeq` which returns `Option[Seq[T]]` This mechanism is used for instance in pattern `case List(x1, ..., xn)`.
60+
Sometimes, the number of sub-values isn't fixed and we would like to return a sequence. For this reason, you can also define patterns through `unapplySeq` which returns `Option[Seq[T]]` This mechanism is used for instance in pattern `case List(x1, ..., xn)`.

0 commit comments

Comments
 (0)