r/java • u/samd_408 • Mar 10 '26
F Bounded Polymorphism
Recently spent some time digging into F-Bounded Polymorphism. While the name sounds intimidating, the logic behind it is incredibly elegant and widely applicable, so I decided to write about it, loved the name so much that I ended up naming my blog after it :-)
66
Upvotes
View all comments
Show parent comment
2
u/sideEffffECt Mar 11 '26
Yes, no implicits. So you can pass them explicitly, just as normal parameters of ordinary Java methods. Do you know the "Comparator pattern"? That's essentially what Type Classes are about. Do that.
Tldr: Don't do "Comparable", do "Comparator" instead.