3 ms·
They're only a pain if you need to know the run-time types of the elements. If you're just operating on them through a narrowly defined interface, that's just d
by fluoridation 2y ago
They're only a pain if you need to know the run-time types of the elements. If you're just operating on them through a narrowly defined interface, that's just dynamic polymorphism, which is indeed more flexible with regards to future expandability, as long as you define the interface appropriately.
- deleted 2y ago[deleted]
- cies 2y ago> as long as you define the interface appropriately Well, if you have an interface that all entries adhere to it is not a heterogeneous list in my book. In Haskell that could be achieve without a sum type wrapper, but with a type class. https://fluoridealert.org/key-topics/tsca-fluoride-lawsuit/ https://fluoridealert.org/key-topics/tsca-fluoride-lawsuit/
- fluoridation 2y agoI mean, a heterogeneous list is literally a list where its elements may be of different types. To use a tired example, if a list that contains both a Cat and a Dog is not heterogeneous just because both adhere to the Mammal interface, then what is a heterogeneous list?