Skip to content

Commit 373f599

Browse files
oderskybishabosha
andauthored
Update content/typeclasses-syntax.md
Co-authored-by: Jamie Thompson <[email protected]>
1 parent 4073888 commit 373f599

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

content/typeclasses-syntax.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ Besides `=>` is also used in other languages that support type classes (e.g.: Ha
648648

649649
As an example, the most natural reading of
650650
```scala
651-
given [A: Ord] => List[Ord[A]]
651+
given [A: Ord] => Ord[List[A]]
652652
```
653653
is _if `A` is `Ord` then `List[A]` is `Ord`_, or, equivalently, `A` is `Ord` _implies_ `List[A]` is `Ord`, hence the `=>`. Another way to see this is that
654654
the given clause establishes a _context function_ of type `[A: Ord] ?=> List[Ord[A]]` that is automatically applied to evidence arguments of type `Ord[A]` and that yields instances of type `List[Ord[A]]`. Since givens are in any case applied automatically to all their arguments, we don't need to specify that separately with `?=>`, a simple `=>` arrow is sufficiently clear and is easier to read.

0 commit comments

Comments
 (0)