Skip to content

Commit ff27cc2

Browse files
authored
Merge pull request #26 from SethTisue/expand-readme
expand README.md
2 parents 6680445 + 4e29d22 commit ff27cc2

File tree

2 files changed

+75
-4
lines changed

2 files changed

+75
-4
lines changed

README.md

+74-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,75 @@
1-
# Scala Parallel Collections
1+
# Scala parallel collections
22

3-
This Scala standard library module contains the package `scala.collection.parallel` with all parallel collections that
4-
used to be part of `scala-library` before Scala 2.13.
3+
This Scala standard module contains the package
4+
`scala.collection.parallel`, with all of the parallel collections that
5+
used to be part of the Scala standard library.
6+
7+
As of Scala 2.13.0-M1, this module is a separate JAR that can be
8+
omitted from projects that do not use parallel collections.
9+
10+
## Maintenance status
11+
12+
This module is maintained by the Scala team at Lightbend. If you are
13+
interested in participating, please jump right in on issues and pull
14+
requests.
15+
16+
Modest, targeted improvements to the existing codebase are welcome at
17+
any time. More fundamental or sweeping changes should probably wait
18+
until after the
19+
[Scala 2.13 collections rework](http://www.scala-lang.org/blog/2017/02/28/collections-rework.html)
20+
is closer to final form.
21+
22+
## Usage
23+
24+
To depend on scala-parser-combinators in sbt, add this to your `build.sbt`:
25+
26+
```
27+
libraryDependencies +=
28+
"org.scala-lang.modules" %% "scala-parser-combinators" % "0.1.2"
29+
```
30+
31+
In your code, adding this import:
32+
33+
```
34+
import scala.collection.parallel.CollectionConverters._
35+
```
36+
37+
will enable use of the `.par` method as in earlier Scala versions.
38+
39+
### Cross-building: dependency
40+
41+
This module is published only for the Scala 2.13.x series, so in a
42+
cross-built project, the dependency should take this form:
43+
44+
```scala
45+
libraryDependencies ++=
46+
CrossVersion.partialVersion(scalaVersion.value) match {
47+
case Some((2, minor)) if minor >= 13 =>
48+
Seq("org.scala-lang.modules" %% "scala-parser-combinators" % "0.1.2")
49+
case _ =>
50+
Seq()
51+
}
52+
```
53+
54+
This way of testing `scalaVersion` is robust across varying Scala
55+
version number formats (nightlies, milestones, release candidates,
56+
community build, etc).
57+
58+
### Cross-building: source compatibility
59+
60+
Using `.par` is problematic in a cross-built project, since in Scala
61+
2.13 the `CollectionConverters._` import shown above is necessary, but
62+
in earlier Scala versions, that import will not compile.
63+
64+
You may able to avoid the problem by directly constructing your
65+
parallel collections rather than going through `.par`. For other
66+
possible workarounds, see
67+
https://github.com/scala/scala-parallel-collections/issues/22,
68+
which is still under discussion (as of April 2017).
69+
70+
## Releasing
71+
72+
As with other Scala standard modules, build and release infrastructure
73+
is provided by the
74+
[sbt-scala-modules](https://github.com/scala/sbt-scala-modules/) sbt
75+
plugin.

build.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import ScalaModulePlugin._
22

3-
version in ThisBuild := "0.1.2-SNAPSHOT"
3+
version in ThisBuild := "0.1.3-SNAPSHOT"
44

55
scalaVersionsByJvm in ThisBuild := {
66
val v213 = "2.13.0-M1"

0 commit comments

Comments
 (0)