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

Strip out isos #71

Closed vil1 closed 4 years ago

vil1 commented 4 years ago

This PR changes the encoding once again, and simplifies things a bit. The main changes are:

So now, a SchemaZ is composed of a "simple" structure (a Fix[SchemaF]) that represents the subject type in terms of "sum of products" and an isomorphism from this representation to the subject type itself.

codecov-io commented 4 years ago

Codecov Report

Merging #71 into prototyping will increase coverage by 0.09%. The diff coverage is 69.12%.

Impacted file tree graph

@@               Coverage Diff               @@
##           prototyping      #71      +/-   ##
===============================================
+ Coverage        70.54%   70.63%   +0.09%     
===============================================
  Files               18       18              
  Lines              516      521       +5     
  Branches             6        9       +3     
===============================================
+ Hits               364      368       +4     
- Misses             152      153       +1
Impacted Files Coverage Δ
...ules/play-json/src/main/scala/PlayJsonModule.scala 0% <0%> (ø) :arrow_up:
modules/core/src/main/scala/Json.scala 92.85% <100%> (ø) :arrow_up:
modules/scalacheck/src/main/scala/GenModule.scala 90% <100%> (ø) :arrow_up:
...dules/tests/src/main/scala/GenModuleExamples.scala 95.23% <100%> (ø) :arrow_up:
...dules/tests/src/main/scala/MigrationExamples.scala 83.78% <100%> (ø) :arrow_up:
...odules/tests/src/main/scala/GenericGenModule.scala 81.25% <100%> (+1.25%) :arrow_up:
modules/generic/src/main/scala/ShowModule.scala 94.73% <100%> (-5.27%) :arrow_down:
...es/tests/src/main/scala/SchemaModuleExamples.scala 100% <100%> (+9.09%) :arrow_up:
...odules/generic/src/main/scala/GenericAlgebra.scala 91.66% <100%> (-0.65%) :arrow_down:
modules/core/src/main/scala/migrations.scala 37.5% <39.13%> (+4.16%) :arrow_up:
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update e03f0bc...902c7b5. Read the comment docs.