by cies · 5y ago · 0 comments
Generics... Well, I just come from a Elm gig (knowing Haskell/C++/Java/Kotlin/Ruby) and I must say I was not too bothered with the lack of generics there.
Elm has generics.
No. That would be fixed by having something akin to typeclasses, traits or interfaces.
Elm's List, Maybe and Array are all defined using a generic type parameter.
BTW, one doesn't have to chose between them in Go either, but only because there are under-the-hood generics for the native types, that are only accessible to the language designers.
https://en.wikipedia.org/wiki/Parametric_polymorphism