Skip to content

Commit 6b6cd39

Browse files
aestevebishabosha
andauthored
oo polymorphism vs. parametric polymorphism
Co-Authored-By: Jamie Thompson <[email protected]>
1 parent 4c81c46 commit 6b6cd39

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/docs/reference/contextual/typeclasses-new.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ given readerMonad[Ctx] as Monad[[X] =>> Ctx => X] {
266266
### Summary
267267

268268
The definition of a _typeclass_ is expressed via a parameterised type with abstract members, such as a `trait`.
269-
The main difference with other traits resides in how these traits are implemented.
269+
The main difference between object oriented polymorphism, and ad-hoc polymorphism with _typeclasses_, is how the definition of the _typeclass_ is implemented, in relation to the type it acts upon.
270270
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.
271271

272272
In addition to these given instances, other constructs like extension methods, context bounds and type lambdas allow a concise and natural expression of _typeclasses_.

0 commit comments

Comments
 (0)