News for hackers. Stuff that matters.
Re:Go generics draft design: building a hashtable by qtplatypus on Wednesday June 17, 2020 @08:19PM (#23558413)
Sum types and Generics solve different but related problems. So they are not really comparable. I would like to see both get implemented.
Re:Go generics draft design: building a hashtable by ccktlmazeltov on Wednesday June 17, 2020 @09:58PM (#23558999)
I'd say it's really hard to abuse sum types, I wouldn't say the same of generics.
Re:Go generics draft design: building a hashtable by qtplatypus on Friday June 19, 2020 @12:21AM (#23570943)
That is true. However sum types don't allow us to abstract over common code. For example a sum type wouldn't allow us to create a type safe channel "fan in" function that works for all channel types.