Skip to content

Commit 8bbce58

Browse files
authored
Merge pull request #2156 from ramezgerges/context-types-fix
Minor mistakes in ca-context-bounds.md
2 parents 52cf4b2 + 90869d1 commit 8bbce58

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

_overviews/scala3-book/ca-context-bounds.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ In that case you don’t have to define a parameter name, and can just provide t
2222
For example, this `maximum` method takes a _context parameter_ of type `Ord`, only to pass it on as an argument to `max`:
2323

2424
```scala
25-
def maximum[T](xs: List[A])(using ord: Ord[A]): A =
25+
def maximum[A](xs: List[A])(using ord: Ord[A]): A =
2626
xs.reduceLeft(max(ord))
2727
```
2828

2929
In that code the parameter name `ord` isn’t actually required; it can be passed on as an inferred argument to `max`, so you just state that `maximum` uses the type `Ord[A]` without giving it a name:
3030

3131
```scala
32-
def maximum[T](xs: List[A])(using Ord[A]): A =
32+
def maximum[A](xs: List[A])(using Ord[A]): A =
3333
xs.reduceLeft(max)
3434
```
3535

0 commit comments

Comments
 (0)