Skip to content

Commit 22162be

Browse files
committed
Improve documentation
1 parent baec08b commit 22162be

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

docs/docs/reference/dropped-features/limit22.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ The limits of 22 for the maximal number of parameters of function types
77
and the maximal number of fields in tuple types have been dropped.
88

99
Functions can now have an arbitrary number of
10-
parameters. Functions beyond Function22 are represented with a new trait
11-
`scala.FunctionXXL`.
10+
parameters. Functions beyond Function22 are erased to a new trait
11+
`scala.FunctionXXL` and tuples beyond Tuple22 are erased to a new trait `scala.TupleXXL`.
12+
Both of these are implemented using arrays.
1213

1314
Tuples can also have an arbitrary number of fields. Furthermore, they support generic operation such as concatenation and indexing.

docs/docs/reference/other-new-features/tupled-function.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ trait TupledFunction[F, G] {
2222
}
2323
```
2424

25+
The compiler will synthesize an instance of `TupledFunction[F, G]` if:
26+
27+
* `F` is a function type of arity `N`
28+
* `G` is a function with a single tuple argument of size `N` and it's types are equal to the arguments of `F`
29+
* The return type of `F` is equal to the return type of `G`
30+
* `F` and `G` are the same kind of functions (`given` arguments or not)
2531

2632
Examples
2733
--------

0 commit comments

Comments
 (0)