Do you like Shapeless, this great API developed by Miles Sabin studying generic/polytypic programming in Scala?
Do you like Play-json, the Play Json 2.1 Json API developed for Play 2.1 framework and now usable as stand-alone module providing functional & typesafe Json validation and Scala conversion?
Here is Shapelaysson an API interleaving Play-Json with Shapeless to be able to manipulate Json from/to Shapeless HList
HList are heterogenous polymorphic lists able to contain different types of data and able to keep tracks of these types
Shapelaysson is a Github project with test/samples
Shapelaysson
takes part in my reflexions around manipulating pure data structures from/to JSON.
A few pure Json from/to HList samples
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
|
A few Json Reads/Writes[HList] samples
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
|
Adding shapelaysson in your dependencies
In your Build.scala
, add:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
|
More to come maybe in this draft project… Suggestions are welcome too
Have Fun :: HNil!