- About Scala
- In the Enterprise
- Scala Community
- Language Research
- In the Press
- The Scala Team
- Scala's Prehistory
- Contact Us
- Learning Scala
- Tour of Scala
- Scala API
- Setup & Getting Started
- Programming Guides
- Other Guides
- Code Examples
- Scala Developers
Why Set aren't covariant
an answer says that Set are invariant in its type parameter because of the
concept behind sets as functions.
Then the author of the question asked what advantages does "a set as a
function" has over a "set as a collection" ?
I'm just wondering the same thing as I end up quite often using a List
rather than a Set (in places where a Set would be more appropriate and more
meaningful) because of the variance difference.
Does anyone has an answer to that ?
If this has to remain like that how would you work around this problem ?