Add [@@deriving qcheck] support in interface files - #409
Conversation
Register a `sig_type_decl` expander for both `qcheck` and `qcheck2` derivers, so that `[@@deriving qcheck]` in `.mli` files generates val declarations for generators (and arbitraries for QCheck). For example: type 'a t [@@deriving qcheck2] produces: val gen : 'a QCheck2.Gen.t -> 'a t QCheck2.Gen.t Parametrized types are handled by adding one `Gen.t` arrow per type parameter. Sized generator signatures (`gen_*_sized`) are intentionally left out. Closesc-cube#189
jmid
commented
May 7, 2026
Thanks a bunch for this! 🙏 |
Of course, take your time! It took me months to motivate myself to write this and months before to consider contributing, what's a few more months! |
Niols
commented
Aug 7, 2026
Hey there! Gentle ping, but there is still no rush :-) |
jmid
left a comment
There was a problem hiding this comment.
Thanks a bunch for this - and sorry for the delay.
LGTM!
Minor nit: The comments regarding the arb-generator can perhaps state
a bit more clearly that this is strictly for QCheck. I've made a few suggestions
there, which I'll commit and then merge.
Thanks again! 🙏
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Jan Midtgaard <mail@janmidtgaard.dk>
jmid
commented
Aug 30, 2026
I've also added a brief mention of the module signature support in the CI is failing on 32-bit workflows which is an unrelated issue #415 |
Niols
commented
Aug 30, 2026
Thanks a lot! No worries about the timing, I know how it goes. Thanks for coming back to it :-) IIUC I have nothing to do, but if you'll have me do something I'll happily oblige (but I don't touch a computer until mid-September at the earliest). |
Uh oh!
There was an error while loading. Please reload this page.
Register a
sig_type_declexpander for bothqcheckandqcheck2derivers, so that[@@deriving qcheck]in.mlifiles generates val declarations for generators (and arbitraries for QCheck).For example:
produces:
Parametrized types are handled by adding one
Gen.tarrow per type parameter. Sized generator signatures (gen_*_sized) are intentionally left out.Closes#189
I hope this addresses the concerns raised in #286 — let me know if there is anything you would like to see improved.