Deriver: support qcheck and qcheck2
The deriver should create QCheck and QCheck2 generators.
The choice could be given in the deriver's plugin name: [@@deriving qcheck] and [@@deriving qcheck2].
[@@deriving qcheck]and[@@deriving qcheck2].
Looks like good names to me!
I think qcheck and qcheck2 are fine when we only derive one thing. When #191 is done, what would the plugin qcheck derives?
We could have the library version as a prefix: [@@deriving qcheck.gen] and [@@deriving qcheck.shrinker]
Would it make sense for [@@deriving qcheck] to also produce an arbitrary object in addition to gen + shrinker? The suffix versions would be used to derive only specific components.
Would it make sense for
[@@deriving qcheck]to also produce an arbitrary object in addition to gen + shrinker?
Well, yes we can. However, there are two solutions:
- Derive generator and call
QCheck.makeon them -> PROS: this is really easy to implement -> CONS: arbitrary fields will be missing (e.g. printer) - Specific derivation for arbitrary -> PROS: use built-in arbitrary (i.e. with printer, shrinkers etc). -> CONS: needs time
The suffix versions would be used to derive only specific components.
Oh yes