Coder Social home page Coder Social logo

collection-strawman's Introduction

Collection-Strawman

Join the chat at https://gitter.im/scala/collection-strawman Waffle.io board

Implementation of the new collections of Scala 2.13.

Current Status and Roadmap

The new collections are available as a regular external library (see below usage instructions). The collections live in the strawman.collection namespace (instead of scala.collection).

Almost all operations and collection types of the current standard collections are available. If you see something missing, please create an issue.

The new collections will be part of the 2.13.0-M4 Scala distribution, where they will replace the standard collections.

Use it in your project

Build setup

Add the following dependency to your project:

libraryDependencies += "ch.epfl.scala" %% "collection-strawman" % "0.9.0"
libraryDependencies += "ch.epfl.scala" %% "collections-contrib" % "0.9.0" // optional

The 0.9.0 version is compatible with Scala 2.13 and Dotty 0.6. Scala 2.12 is also supported but you might encounter type inference issues with it.

We also automatically publish snapshots on Sonatype:

resolvers += Resolver.sonatypeRepo("snapshots")

libraryDependencies += "ch.epfl.scala" %% "collection-strawman" % "0.10.0-SNAPSHOT"

The collections-contrib artifact provides additional operations on the collections (see the Additional operations section).

API Documentation

Migrating from the standard collections to the strawman

There is an entry in the FAQ that aims to list all breaking changes.

A tool is being developed to automatically migrate code that uses the standard collection to use the strawman.

To use it, add the scalafix sbt plugin to your build, as explained in its documentation.

Two situations are supported: (1) migrating a 2.12 code base to a 2.12 code base that uses the collection strawman as a library (instead of the standard collections), and (2) migrating a 2.12 code base to 2.13 code base.

The migration tool is not exhaustive and we will continue to improve it over time. If you encounter a use case that’s not supported, please report it as described in the contributing documentation.

Migrating a 2.12 code base to a 2.12 code base that uses the collection strawman as a library

Run the following sbt task on your project:

> scalafix https://github.com/scala/collection-strawman/raw/master/scalafix/2.12/rules/src/main/scala/fix/Collectionstrawman_v0.scala

In essence, the migration tool changes the imports in your source code so that the strawman definitions are imported. It also rewrites expressions that use an API that is different in the strawman.

Migrating a 2.12 code base to 2.13 code base

Run the following sbt task on your project:

> scalafix https://github.com/scala/collection-strawman/raw/master/scalafix/2.13/rules/src/main/scala/fix/Collectionstrawman_v0.scala

Contributing

We welcome contributions!

For more information, see the CONTRIBUTING file.

collection-strawman's People

Contributors

ackratos avatar allanrenucci avatar biboudis avatar epronovost avatar foobatman avatar hrhino avatar ichoran avatar isnotinvain avatar jiminhsieh avatar julienrf avatar kelebra avatar lptk avatar lrytz avatar marcelocenerine avatar msteindorfer avatar nicolasstucki avatar nthportal avatar odd avatar odersky avatar olafurpg avatar optician avatar pnf avatar psycho7 avatar sethtisue avatar shawjef3 avatar smarter avatar szeiger avatar tim-ruhland avatar tpolecat avatar xavier-fernandez avatar

Watchers

 avatar  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.