Read Typeclass For Scala
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
project
src/main/scala/io/chrisdavenport/read
.gitignore
.scalafmt.conf
.travis.yml
LICENSE
README.md
build.sbt
version.sbt

README.md

read Build Status Maven Central

Read Typeclass for Scala. Controversial? Yes. Problematic? Yes. Better than watching your friends write string.toInt and calling it good enough? Absolutely!

Quickstart

To use read in an existing SBT project with Scala 2.11 or a later version, add the following dependency to your build.sbt:

libraryDependencies += "io.chrisdavenport" %% "read" % "<version>"

Examples

import io.chrisdavenport.read.Read
import io.chrisdavenport.read.implicits._

"1".read[Int] // Right(1)

"Foo".read[Int] // Left

// For Those Who Want Haskell's Read
Read[Int].unsafeRead("1") // 1: Int