Search code examples
scalascala-collectionsscala-3

Is there a Scala 3 specific standard library or is it just inherited from Scala 2?


Is it the case that Scala 3 uses all the collections from Scala 2 standard library? (What elements Scala "standard library" consists of?)

Is there any Scala 3 specific "standard library"?

Are there plans to reimplement Scala 2 libraries to Scala 3?

I was looking for an implementation of an immutable list in Scala 3 and I realized that there seems to be no such thing in the dotty repo.

I was expecting to find an implementation of Scala 2 list in the dotty repo as well.


Solution

  • The standard library is shared between Scala 3 and Scala 2.13 and is maintained as part of Scala 2.13.

    The standard library was refactored / re-engineered such that it only uses language features that exist in both Scala 2.13 and Scala 3.

    (Note: when I write "Scala 3" and "Scala 2.13", I mean the implementations with those version numbers. The Scala Language Specification does not say anything about how the standard library is implemented.)