0

Working with the Play Framework's JSON Library, I'm creating a Format[T] for some class T.

val a: JsPath = (JsPath \ "age")
val b: Format[Int] = (JsPath \ "age").format[Int]
val x: FunctionalBuilder[OFormat]#CanBuild2[Int, String] = ( 
           (JsPath \ "age").format[Int] and 
           (JsPath \ "location").format[String]
       )

Looking at the explicit types, we see that (in x) calling Format[Int] and Format[String] returns a type of FunctionalBuilder[OFormat]#CanBuild2[Int, String].

How does this conversion occur in the Play Framework JSON Library source?

Kevin Meredith
  • 41,036
  • 63
  • 209
  • 384
  • possible duplicate of [Syntax and meaning of a Scala/Play! code sample](http://stackoverflow.com/questions/20990812/syntax-and-meaning-of-a-scala-play-code-sample) – senia Feb 23 '14 at 05:46
  • try `val r1 = (JsPath \ "age").format[Int]`; `val r2 = (JsPath \ "location").format[String]`; `import scala.reflect.runtime.{universe => u}`; `u.show{ u.reify{ r1 and r2 }.tree }`. – senia Feb 23 '14 at 05:48
  • thanks, @senia. I voted to close given that you already answered it at the above link. – Kevin Meredith Feb 24 '14 at 13:26

0 Answers0