Skip to content

Instantly share code, notes, and snippets.

@sritchie
Created February 12, 2014 21:34
Show Gist options
  • Save sritchie/8964995 to your computer and use it in GitHub Desktop.
Save sritchie/8964995 to your computer and use it in GitHub Desktop.
[info] Compiling 25 Scala sources and 2 Java sources to /Users/sritchie/code/scala/bijection/bijection-core/target/scala-2.9.3/classes...
[warn] warning: [options] bootstrap class path not set in conjunction with -source 1.6
[warn] 1 warning
[info] Starting scala interpreter...
[info]
Welcome to Scala version 2.9.3 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_40).
Type in expressions to have them evaluated.
Type :help for more information.
scala> import com.twitter.bijection.Conversion.asMethod
import com.twitter.bijection.Conversion.asMethod
scala> 100.as[String]
res0: String = 100
scala> "100".as[Option[Int]]
res1: Option[Int] = Some(100)
scala> 100.as[com.twitter.bijection.EnglishInt]
res2: com.twitter.bijection.EnglishInt = EnglishInt(one hundred)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment