Closed vil1 closed 6 years ago
I would like to take this one.
I think it would be highly beneficial if you were able to provide this functionality by means of a Schema ~> Gen
natural transformation.
Doing so will probably give us insights about ways to later generalize this to Schema ~> F
(telling us which typeclass instances are required for F
for example).
Hi @josipgrgurica, did you make any progress on this, do you need some help?
Hi @vil1, I stuck on part where I need to create record from schema and field values. I saw that record schema is defined in terms of applicative in xenomorph, should I try to add it in our record schema?
Well, I'm not sure you need an Applicative[RecordSchema]
for this (but I might be wrong), what is certain though is that you'll need an Applicative[Gen]
.
If you have written some code already, why not pushing a WIP PR (or pointing me to the corresponding branch on your own fork) so that I can take a look?
Sure, I'll push it later today.
In order to see how far we can go with our current approach, we need to make sure the current Schema AST allows for concrete features like giving free scalacheck
Gen
instance from a schema.That is, provided we have
Gen
instances for all the primitive types in a schema, we need to produce aGen
for the whole schema.The (commented out) signature for
gen
inmodules/scalacheck/src/main/scala/GenModule.scala
might need to be adapted to fit that purpose.