You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/reference/contextual/typeclasses-new.md
+6-1Lines changed: 6 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -106,5 +106,10 @@ given readerMonad[Ctx] as Monad[[X] =>> Ctx => X] {
106
106
}
107
107
```
108
108
109
+
### Summary
109
110
110
-
The conjunction of given instances, extension methods and context bounds allow a concise and natural expression of _typeclasses_
111
+
The definition of a _typeclass_ is expressed in Scala 3 via a `trait`.
112
+
The main difference with other traits resides in how these traits are implemented.
113
+
In the case of a _typeclass_ the trait's implementations are expressed through `given ... as` type definitions, and not through classes that `extends` the trait linearly.
114
+
115
+
In addition to these given instances, extension methods and context bounds allow a concise and natural expression of _typeclasses_.
0 commit comments