This is a backport library of Scala Standard Library scala.util
package from 2.13 to 2.12 and 2.11.
2.13 scala.util
package contains following new features.
- tap
- pipe
- Using (loan pattern)
util-backports is available from maven central.
If you use SBT you can include util-backports in your project with
libraryDependencies += "com.github.bigwheel" %% "util-backports" % "2.1"
import scala.util.chaining._
val str = "42"
str.tap(println)
println(1 + str.pipe(_.length))
import scala.util.Using
Using.resource(new PrintWriter("write-target.txt")) { pw =>
pw.write("hello world")
// no need to close !
}
git clone [email protected]:scala/scala.git
cd scala
git diff --stat=300,300 --stat-graph-width=20 origin/2.12.x..origin/2.13.x -- src/library/scala/util
git diff --stat=300,300 --stat-graph-width=20 origin/2.12.x..origin/2.13.x -- test/junit/scala/util