A purely-functional library for defining type-safe schemas for algebraic data types, providing free generators, SQL queries, JSON codecs, binary codecs, and migration from this schema definition.
SchemaZ defines a generic representation of algebraic data structures and combinators that turn such schema into a generic computation over arbitrary data. In other words, SchemaZ provides a way to express any computation that abstracts over the structure of data, such as:
Gen
) that produce data satisfying that schema.codecs | generators | migrations | diff/patch | queries | |
---|---|---|---|---|---|
xenomorph | โ | โ | ? | ๐ | ๐ |
shapeless * | โ | โ | ๐ | โ | ๐ |
*: shapeless provides only the way to abstract over the structure of data, but several libraries build upon shapeless to provide the feature listed in the table.
Skeumorph is also a possible competitor, however it is focused on providing translation between different formats (Avro, Protobuf and Mu). This is achieved by using a central Schema Representation which can losslessly translate to each of the previously mentioned formats.
SchemaZ shares ideas with @nuttycom's xenomorph library. The talk below presents its design.
<img src="http://img.youtube.com/vi/oRLkb6mqvVM/0.jpg" alt="Describing Data...with free applicative functors (and more)โKris Nuttycombe" width="240" height="180" border="10" />
An Haskell port of the ideas of xenomorph has also been implemented: haskell-schema.