summaryrefslogtreecommitdiff
path: root/src/library/rootdoc.txt
blob: e84942b8c4bc844399698647c0508c35d866c22b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
This is the documentation for the Scala standard library.

== Package structure ==

The [[scala]] package contains core types like [[scala.Int `Int`]], [[scala.Float `Float`]], [[scala.Array `Array`]]
or [[scala.Option `Option`]] which are accessible in all Scala compilation units without explicit qualification or
imports.

Notable packages include:

  - [[scala.collection    `scala.collection`]] and its sub-packages contain Scala's collections framework
    - [[scala.collection.immutable `scala.collection.immutable`]] - Immutable, sequential data-structures such as
      [[scala.collection.immutable.Vector `Vector`]], [[scala.collection.immutable.List `List`]],
      [[scala.collection.immutable.Range `Range`]], [[scala.collection.immutable.HashMap `HashMap`]] or
      [[scala.collection.immutable.HashSet `HashSet`]]
    - [[scala.collection.mutable `scala.collection.mutable`]] - Mutable, sequential data-structures such as
      [[scala.collection.mutable.ArrayBuffer `ArrayBuffer`]],
      [[scala.collection.mutable.StringBuilder `StringBuilder`]],
      [[scala.collection.mutable.HashMap `HashMap`]] or [[scala.collection.mutable.HashSet `HashSet`]]
    - [[scala.collection.concurrent `scala.collection.concurrent`]] - Mutable, concurrent data-structures such as
      [[scala.collection.concurrent.TrieMap `TrieMap`]]
    - [[scala.collection.parallel.immutable `scala.collection.parallel.immutable`]] - Immutable, parallel
      data-structures such as [[scala.collection.parallel.immutable.ParVector `ParVector`]],
      [[scala.collection.parallel.immutable.ParRange `ParRange`]],
      [[scala.collection.parallel.immutable.ParHashMap `ParHashMap`]] or
      [[scala.collection.parallel.immutable.ParHashSet `ParHashSet`]]
    - [[scala.collection.parallel.mutable `scala.collection.parallel.mutable`]] - Mutable, parallel
      data-structures such as [[scala.collection.parallel.mutable.ParArray `ParArray`]],
      [[scala.collection.parallel.mutable.ParHashMap `ParHashMap`]],
      [[scala.collection.parallel.mutable.ParTrieMap `ParTrieMap`]] or
      [[scala.collection.parallel.mutable.ParHashSet `ParHashSet`]]
  - [[scala.concurrent    `scala.concurrent`]] - Primitives for concurrent programming such as
    [[scala.concurrent.Future `Futures`]] and [[scala.concurrent.Promise `Promises`]]
  - [[scala.io            `scala.io`]]     - Input and output operations
  - [[scala.math          `scala.math`]]   - Basic math functions and additional numeric types like
    [[scala.math.BigInt `BigInt`]] and [[scala.math.BigDecimal `BigDecimal`]]
  - [[scala.sys           `scala.sys`]]    - Interaction with other processes and the operating system
  - [[scala.util.matching `scala.util.matching`]] - [[scala.util.matching.Regex Regular expressions]]

Other packages exist.  See the complete list on the left.

Additional parts of the standard library are shipped as separate libraries. These include:

  - [[scala.reflect       `scala.reflect`]]   - Scala's reflection API (scala-reflect.jar)
  - [[scala.xml           `scala.xml`]]    - XML parsing, manipulation, and serialization (scala-xml.jar)
  - [[scala.swing         `scala.swing`]]  - A convenient wrapper around Java's GUI framework called Swing (scala-swing.jar)
  - [[scala.util.continuations `scala.util.continuations`]] - Delimited continuations using continuation-passing-style
    (scala-continuations-library.jar, scala-continuations-plugin.jar)
  - [[scala.util.parsing  `scala.util.parsing`]] - [[scala.util.parsing.combinator Parser combinators]], including an
    example implementation of a [[scala.util.parsing.json JSON parser]] (scala-parser-combinators.jar)
  - [[scala.actors        `scala.actors`]]    - Actor-based concurrency (deprecated and replaced by Akka actors,
    scala-actors.jar)

== Automatic imports ==

Identifiers in the scala package and the [[scala.Predef `scala.Predef`]] object are always in scope by default.

Some of these identifiers are type aliases provided as shortcuts to commonly used classes.  For example, `List` is an alias for
[[scala.collection.immutable.List `scala.collection.immutable.List`]].

Other aliases refer to classes provided by the underlying platform.  For example, on the JVM, `String` is an alias for `java.lang.String`.