This repository was archived by the owner on Dec 22, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 72
FAQ
Lukas Rytz edited this page Jan 27, 2018
·
90 revisions
This page should evolve over time, but already be useful now. When more official documentation is available, content can be replaced by links.
-
collection.breakOut
no longer exists - Method
to[C]
was removed -
MapProxy
,SetProxy
no longer exist -
SynchronizedX
no longer exist -
SeqForwarder
no longer exists - Implicit conversions between Scala and Java collections no longer exist (
convert.ImplicitConversions
/ImplicitConversionsToJava
/ImplicitConversionsToScala
) -- NOTE: they are not deprecated in 2.12. -
MutableList
is no longer public -
TreeMap
/TreeSet
/BitSet
: theto
method is now calledrangeTo
-
immutable.Set/Map
: the+
method no longer has an overload accepting multiple values, soSet(1) + (2, 3)
is nowSet(1) + 2 + 3
-
mutable.Set/Map
no longer has a+
method, somutable.Set(1) + 2
is nowmutable.Set(1).clone() += 2
(https://github.com/scala/collection-strawman/issues/375) -
mutable.Set/Map
no longer has anupdated
method, somutable.Map(1 -> 2).updated(1, 3)
is nomutable.Map(1 -> 2).clone() += 1 -> 3
-
Iterable
no longer has asameElements
method, call.iterator()
first -
colleciton.Seq.union
no longer exists, use++
-
collection.Map
no longer has a--
method -
LinearSeq
no longer has a companion-apply, useList()
-
HashSet.remove
now returns anOption[A]
instead of aBoolean
-
Iterable.partition
invokesiterator
twice and assumes it gets two iterators over the same elements. Strict subclasses overridepartition
do perform only a single traversal.
Are there new implementations of existing collection types (changes in performance characteristics)?
- Compat library
- Accept some deprecation warnings (?)
- sbt's version-specific source folders if necessary, but should not be
No, there are no plans to change the scala.Seq
alias.
Historical discussion: https://groups.google.com/forum/#!topic/scala-internals/g_-gIWgB8Os
Read the draft document on the design of the Scala 2.13 collections: https://github.com/scalacenter/docs.scala-lang/blob/collection-strawman/_overviews/core/architecture-of-scala-collections.md
Examples