News for hackers. Stuff that matters.
Re:An Update on Go and Generics in 2019 by tgirod on Tuesday March 12, 2019 @08:45AM (#19367553)
Interesting read, but I think the first part would benefit from a detour toward interfaces, why they are not good enough to solve the sort problem, and how contracts can help.

IIRC it is along those lines :

You could define a `Lesser` interface with a method `Less(Lesser) bool`, and implement this interface on what you want to sort, but then you would have no way to assert at compile time that x and y are of the same type in `x.Less(y)`.

As I understand them, contracts allow you to assert things like this.

There are no comments on this comment yet.