@@ -9,20 +9,23 @@ Their types are _context function types_. Here is an example of a context functi
99``` scala
1010type Executable [T ] = ExecutionContext ?=> T
1111```
12- Context function are written using ` ?=> ` as the "arrow" sign.
12+ Context functions are written using ` ?=> ` as the "arrow" sign.
1313They are applied to synthesized arguments, in
14- the same way methods with context parameters is applied. For instance:
14+ the same way methods with context parameters are applied. For instance:
1515``` scala
1616 given ec as ExecutionContext = ...
1717
18- def f (x : Int ): Executable [Int ] = ...
18+ def f (x : Int ): ExecutionContext ?=> Int = ...
19+
20+ // could be written as follows with the type alias from above
21+ // def f(x: Int): Executable[Int] = ...
1922
2023 f(2 )(using ec) // explicit argument
2124 f(2 ) // argument is inferred
2225```
2326Conversely, if the expected type of an expression ` E ` is a context function type
2427` (T_1, ..., T_n) ?=> U ` and ` E ` is not already an
25- context function literal, ` E ` is converted to an context function literal by rewriting to
28+ context function literal, ` E ` is converted to a context function literal by rewriting it to
2629``` scala
2730 (using x_1 : T1 , ..., x_n : Tn ) => E
2831```
@@ -59,7 +62,7 @@ the aim is to construct tables like this:
5962 }
6063 }
6164```
62- The idea is to define classes for ` Table ` and ` Row ` that allow
65+ The idea is to define classes for ` Table ` and ` Row ` that allow the
6366addition of elements via ` add ` :
6467``` scala
6568 class Table {
0 commit comments