spartanz / schemaz

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
https://spartanz.github.io/schemaz
Apache License 2.0
164 stars 18 forks source link

Pull the "isos" out of the schema AST #65

Closed vil1 closed 4 years ago

vil1 commented 4 years ago

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".

The impact on migrations is still unknown though.

vil1 commented 4 years ago

fixed by #71