Skip to content

Comment on Should Go 2.0 support generics?parent

Comments

There's no amount of union types that will save you if you want to write a polymorphic, type safe map/filter/reduce function. These functions need to be generic over containers.

At best, with this union type hack what you'll recover is similar to "ad hoc" polymorphism, not true parametric polymorphism.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.