Let’s say it as it is: there’s no language-level support for typeclasses in Kotlin. Dome folks managed to implement something that resembles typeclasses by creatively abusing context receivers (fair play to them) but this is not idiomatic Kotlin. And I only ever see this kind of thing coming from overly enthusiastic folks with a Scala background 🤣.

Reply to this note

Please Login to reply.

Discussion

At first, it was like "I want to write Haskell, but I'm forced to use JVM." Now it's like "I want to write Scala, but I'm forced to use Kotlin" 😂