Giter Site home page Giter Site logo

mziolkowski21 / scala-parallel-collections Goto Github PK

View Code? Open in Web Editor NEW

This project forked from scala/scala-parallel-collections

0.0 0.0 0.0 1.07 MB

Parallel collections standard library module for Scala 2.13+

License: Apache License 2.0

Shell 0.31% Scala 99.69%

scala-parallel-collections's Introduction

Scala parallel collections

This Scala standard module contains the package scala.collection.parallel, with all of the parallel collections that used to be part of the Scala standard library (in Scala 2.10 through 2.12).

For Scala 3 and Scala 2.13, this module is a separate JAR that can be omitted from projects that do not use parallel collections.

Documentation

Maintenance status

This module is community-maintained, under the guidance of the Scala team at Lightbend. If you are interested in participating, please jump right in on issues and pull requests.

Usage

To depend on scala-parallel-collections in sbt, add this to your build.sbt:

libraryDependencies +=
  "org.scala-lang.modules" %% "scala-parallel-collections" % "1.0.3"

In your code, adding this import:

import scala.collection.parallel.CollectionConverters._

will enable use of the .par method as in earlier Scala versions.

Cross-building: dependency

This module is published only for the Scala 3 and 2.13, so in a cross-built project, the dependency should take this form:

libraryDependencies ++= {
  CrossVersion.partialVersion(scalaVersion.value) match {
    case Some((2, major)) if major <= 12 =>
      Seq()
    case _ =>
      Seq("org.scala-lang.modules" %% "scala-parallel-collections" % "1.0.3")
  }
}

This way of testing scalaVersion is robust across varying Scala version number formats (nightlies, milestones, release candidates, community build, etc).

Cross-building: source compatibility

Using .par is problematic in a cross-built project, since in Scala 2.13+ the CollectionConverters._ import shown above is necessary, but in earlier Scala versions, that import will not compile.

You may able to avoid the problem by directly constructing your parallel collections rather than going through .par. For other possible workarounds, see scala#22, which is still under discussion.

Releasing

As with other Scala standard modules, build and release infrastructure is provided by the sbt-scala-module sbt plugin.

scala-parallel-collections's People

Contributors

adriaanm avatar eed3si9n avatar gkossakowski avatar ichoran avatar janekdb avatar jsuereth avatar julienrf avatar lrytz avatar mpociecha avatar nicolasstucki avatar nthportal avatar odersky avatar paulp avatar pavelpavlov avatar phaller avatar retronym avatar ruippeixotog avatar scala-steward avatar sethtisue avatar sjrd avatar soc avatar som-snytt avatar szeiger avatar tiarkrompf avatar viktorklang avatar vladureche avatar vsalvis avatar xeno-by avatar xirc avatar xuwei-k avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.