Scala Collection user manual ? (was missing a good documentation)

17 views
Skip to first unread message

Jan Goyvaerts

unread,
Jun 30, 2011, 8:23:04 AM6/30/11
to scala-user
Related to the mentioned thread and the last ScalaTypes podcast, I was wondering whether a good user manual would help us newbies to understand the evident and adopt Scala.

But maybe there's already such a manual somewhere ?

Usually I'm checking this http://www.decodified.com/scala/collections-api.xml first before choosing a collection type.

Josh Suereth

unread,
Jun 30, 2011, 2:07:56 PM6/30/11
to Jan Goyvaerts, scala-user
I'm currently writing one:  http://www.manning.com/suereth  (Chapter 8)

Once done, I'll see what portions I can blog about.

The link you included is a great look at the whole hierarchy.   The part that it lacks (from the scaladoc) is performance information for actual collection types vs. the performance-ish abstract guarantees on IndexedSeq/LinearSeq etc.

For general app development, as Daniel suggests, stick to a specific collection type.   Staying with Vector for most things should give decent performance and avoid lots of issues with mutable collections.  The other frequented collections are ArrayBuffer (for contained mutable sections) and immutable.List (for head-tail decomposition).  For some reason, when using Map and Set, most of us just use the generic version (which is generally an 'ok' decision).  Unfortunately, doing this with Seq defaults to immutable.List which is not as good as Vector:

scala> val x = Seq(10)
x: Seq[Int] = List(10)


Hope that helps!
- Josh

Jan Goyvaerts

unread,
Jun 30, 2011, 2:35:38 PM6/30/11
to Josh Suereth, scala-user
I've subscribed to the MEAP edition a while ago but had no time yet to read it ... :-)

Daniel Sobral

unread,
Jun 30, 2011, 3:48:13 PM6/30/11
to Jan Goyvaerts, scala-user
What about http://www.scala-lang.org/docu/files/collections-api/collections.html?

--
Daniel C. Sobral

I travel to the future all the time.

Reply all
Reply to author
Forward
0 new messages