i am studying scala and have been trying to learn as much as i can. After reading the scala programming book i am reading the source code of several projects while trying some examples myself.
I am really struggling to understand what this method does. I understand that this defines a Json value such as type : value or something.
And also it expects a parametrized T that is a subtype of Product (<:), the way it uses the hashtags is completely magic to me. I cannot fathom its meaning.
def jsonFormat1[[#P1 :JF#], T <: Product :ClassManifest](construct: ([#P1#]) => T): RootJsonFormat[T] = {
val Array([#p1#]) = extractFieldNames(classManifest[T])
jsonFormat(construct, [#p1#])
}
Here is the Full Source for the trait, you might need it to fully understand
PS: This example is taken from project spray-json.