8000 GitHub - htmldoug/util-backports: A backport library of scala.util in Standard Library from Scala 2.13 to 2.12
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

htmldoug/util-backports

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

util backports from scala 2.13 to 2.12 Build Status

This is a backport library of Scala Standard Library scala.util package from 2.13 to 2.12.

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.0"

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 git@github.com: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

  • Scala 100.0%
0