Skip to content

Commit 5899edd

Browse files
authored
doc(context fun): typos
1 parent 84ea41a commit 5899edd

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

docs/docs/reference/contextual/context-functions.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,23 @@ Their types are _context function types_. Here is an example of a context functi
99
```scala
1010
type 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.
1313
They 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
```
2326
Conversely, 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
6366
addition of elements via `add`:
6467
```scala
6568
class Table {

0 commit comments

Comments
 (0)