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
In the current schema encoding, RecordSchemas (resp. Unions) only make sense when they are built from "labelled products" (resp. "labelled sums"), ie. a product (resp. sum) whose all members are ProductTerms (resp. SumTerms).
It is necessary to (re)introduce a way to make impossible to construct records/unions with anything else than labelled products/sums.
This might be done "syntactically", by exposing methods and syntax that allow just that and nothing else (tweaking the methods' signatures in SchemaSyntax for starters), or by going down the "shapeless-like inductive type-level constraints" path (but that might prove cumbersome because of the "pattern-functorish" nature of Schema).
In the current schema encoding,
RecordSchema
s (resp.Union
s) only make sense when they are built from "labelled products" (resp. "labelled sums"), ie. a product (resp. sum) whose all members areProductTerm
s (resp.SumTerm
s).It is necessary to (re)introduce a way to make impossible to construct records/unions with anything else than labelled products/sums.
This might be done "syntactically", by exposing methods and syntax that allow just that and nothing else (tweaking the methods' signatures in
SchemaSyntax
for starters), or by going down the "shapeless-like inductive type-level constraints" path (but that might prove cumbersome because of the "pattern-functorish" nature ofSchema
).