Hey, Kotliners K We’ve published a new article on implementing type classes in Kotlin. No functional programming experience is needed 😛. We also used a bit of Arrow arrow. Let us know your thoughts!
https://blog.rockthejvm.com/kotlin-type-classes/
👍 4
🙌 2
🤘 1
K 1
Riccardo Cardin
02/06/2024, 7:21 PM
…and here is the video, made by the great @Daniel Ciocirlan
https://www.youtube.com/watch?v=Qhfiq_1eWM8▾
n
Norbert Kiesel
02/07/2024, 3:29 PM
This uses the experimental "context" feature and I thought that the original experiment will be aborted and a different "context" experiment will be started. How is this affecting the presented approach?
r
Riccardo Cardin
02/07/2024, 4:09 PM
TBF, you can implement type classes in Kotlin K without using the context receivers. Just pass the type class as one of the arguments to the function. It’s exactly what the compiler does under the hood when using context receivers 🙂