- Learn Scala Programming
- Slava Schmidt
- 239字
- 2021-06-10 19:35:43
Summary
Scala 2.13 is a minor update of Scala with the main focus on the redesigned collection library. The few small additions to the standard library, such as automatic resource management, just accentuate this fact.
The new collection library mainly consists of two intermixed inheritance hierarchies with a similar shape. Members of the first hierarchy describe the structure of the collection and members of the second hierarchy—operations available on this collection type. Because of the inheritance relations, the collections situated lower in the tree define additional methods for more specific collections and override methods defined by the parent traits to provide more efficient implementation as required.
The three main collection types are Seq, Set, and Map. Each of these types has multiple implementations that are useful in specific situations. Set is also a function of one argument; Seq and Map are PartialFunctions.
Most of the collections are available in mutable and immutable forms.
In addition to the collection hierarchies, there is a concept of View, which is a reified definition of iterators’ operations and can be used to lazily apply transformations to the collection. Another related abstraction is IterableFactory, which implements some general ways to create collection instances and to perform conversions between collection representations.
In the next chapter, we will shift our focus from the new features of version 2.13 to a general exploration of Scala, starting with its type system.
- The Supervised Learning Workshop
- Mastering JavaScript Object-Oriented Programming
- YARN Essentials
- Java設(shè)計(jì)模式及實(shí)踐
- D3.js 4.x Data Visualization(Third Edition)
- Python Web數(shù)據(jù)分析可視化:基于Django框架的開(kāi)發(fā)實(shí)戰(zhàn)
- 單片機(jī)C語(yǔ)言程序設(shè)計(jì)實(shí)訓(xùn)100例
- Instant PHP Web Scraping
- C指針原理揭秘:基于底層實(shí)現(xiàn)機(jī)制
- Java Web開(kāi)發(fā)實(shí)例大全(基礎(chǔ)卷) (軟件工程師開(kāi)發(fā)大系)
- 零基礎(chǔ)C#學(xué)習(xí)筆記
- Keil Cx51 V7.0單片機(jī)高級(jí)語(yǔ)言編程與μVision2應(yīng)用實(shí)踐
- 編寫(xiě)高質(zhì)量代碼之Java(套裝共2冊(cè))
- 計(jì)算機(jī)應(yīng)用基礎(chǔ)
- 像程序員一樣使用MySQL