Ad-Hoc Polymorphism: Interfaces vs. Traits vs. Type Classes
Three languages, three solutions to “different types, same operation” and three very different opinions about who gets to decide what an implementation means. Every mainstream type...
Search fresh public links, source activity, and ready-to-use post angles for Ad-Hoc Polymorphism.
Fresh curated links around Ad-Hoc Polymorphism are collected here so marketers can spot useful updates and turn timely ideas into posts faster.
Recent items include:
Recent curated links from global sources. Generate one free draft from any story, then use SocialBu to schedule and refine your content calendar.
Three languages, three solutions to “different types, same operation” and three very different opinions about who gets to decide what an implementation means. Every mainstream type...
Java, Rust, Scala, and Haskell all let you say “a Shape is exactly a Circle, a Square, or a Triangle, and nothing else.” They disagree sharply on what happens when you forget to ha...
Adding a new type is trivial in object-oriented code. Adding a new operation is trivial in functional code. Nobody has ever gotten both for free, and understanding why explains a l...
Java 8 gave interfaces actual behavior, then had to answer the same question C++ has been arguing about for thirty years. It answered it much better. The exact compiler rules, veri...
A conditional that keeps growing is a design problem, not a style problem. How to turn each branch into an object, one green step at a time.
Originally appeared on Awesome Ruby Newsletter.
Java’s type system disagrees with itself about one question: if String is an Object, is String[] an Object[]? Arrays say yes. Generics say absolutely not. Both answers were deliber...
Practice generics with a short swift challenge.
Ask four different languages “what was T, once my code actually runs?” and you get four genuinely different answers. Each one is a real trade between flexibility and cost, not a mi...
Use SocialBu to discover ideas, generate post drafts, and schedule them across your social channels.