Add Prism for Json conversion #14

julien-truffaut opened this Issue Feb 26, 2014 · 5 comments


None yet

3 participants


No description provided.


@julien-truffaut Have you got any details for this one? Is it easy? :-)


It is quite a big project, the first part consist of creating Prism from String to Json AST:

sealed trait Json
case class StringJson(s: String) extends Json
case class NumberJson(n: BigDecimal) extends Json
case class ObjectJson(obj: Map[String, Json]) extends Json

toJsonAST: SimplePrism[String, Json]
toJsonAST.get("{"key" : "value"}") == Some(ObjectJson(Map("key", StringJson("value"))))
toJsonAST.get("...") == None


Would it be sensible to use Argonaut?


I haven't really looked into it yet. We can either create the interface with some type classes and then propose bindings for common Json libraries or simply base the implementation on a single Json library.

The latter is probably easier but it adds another dependency and I would like to limit them as much as possible. I am open to any proposal ;)


Argonaut will add a dependency to Monocle, we will make the integration their.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment