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
We can (and should) pull the "isos" out of the SchemaF pattern-functor.
We would end up with a user-facing SchemaZ case class containing an "iso" from a business type T to a generic representation (sums of products) A and a Schema[A].
The typeclass derivation would still work the same: it would derive instances for A and corresponding instances for T would be obtained by maping or contramaping the relevant half of the "iso".
We can (and should) pull the "isos" out of the
SchemaF
pattern-functor.We would end up with a user-facing
SchemaZ
case class containing an "iso" from a business typeT
to a generic representation (sums of products)A
and aSchema[A]
.The typeclass derivation would still work the same: it would derive instances for
A
and corresponding instances forT
would be obtained bymap
ing orcontramaping
the relevant half of the "iso".The impact on migrations is still unknown though.