Advertisement
Guest User

Untitled

a guest
Apr 30th, 2015
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.35 KB | None | 0 0
  1.     import scalaz._
  2.  
  3.     trait UserName
  4.     trait Email
  5.  
  6.     case class Person(userName: String @@ UserName, email: String @@ Email)
  7.  
  8.     val jsonString =
  9.       """{
  10.        |"userName": "larry", "email": "larry@seinfeld.com"
  11.        |}
  12.      """.stripMargin
  13.  
  14.     implicit val formats = DefaultFormats
  15.  
  16.     val p = read[Person](jsonString)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement