Skip to content

A backport library of scala.util in Standard Library from Scala 2.13 to 2.12

License

Notifications You must be signed in to change notification settings

bigwheel/util-backports

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

util backports from scala 2.13 to 2.12 and 2.11Build Status

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)

Installation

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"

Usage

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 !
}

Hint for util-backports developers

How to check util package new feature in 2.13

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

About

A backport library of scala.util in Standard Library from Scala 2.13 to 2.12

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages