Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Typeclasses in perspective #2
Comments left here will be displayed on this blog post: https://diogocastro.com/blog/2018/06/17/typeclasses-in-perspective/
Thanks for the great write-up; I learned a lot! I'm still pretty new to static-typing, so I find stuff like this really helpful.
Is my understanding correct that the Java example in the "Conditional implementation" section:
While this isn't possible in Java, it's essentially what Kotlin extension functions allow? So that means that while Kotlin's type system solves the "Extensibility" shortcoming mentioned in this article, the other four still remain?
@aaronj1335: I'm not familiar with Kotlin, but from scanning that link, Kotlin's extension functions look a lot like C#'s extension methods, which are just syntactic sugar for static methods:
These would allow you to "add" a
Even though they are convenient, extension functions/methods are not a means of abstraction.