Module Core.Gens

val infer_gens_from_sig : loc:Ppxlib.location -> Ppxlib.signature_item -> Ppxlib.expression option list

infer_gens_from_sig loc sig extract the generators needed for the signature item, which must be a Psig_value.

ppx_deriving_qcheck is used to create generators from core_type inside the signature. If the deriver was not able to derive a core_type inside sig, it is replaced by the value None.

val create_gens : loc:Ppxlib.location -> Ppxlib.signature_item option -> Properties.property_name -> Properties.gen list -> Ppxlib.expression * Ppxlib.expression Common.Helpers.Pairs.nested_pairs

create_gens loc sig_item property gens extract QCheck generators from the combination of gens and sig_item.

In priority, generators are taken from gens. In the case where sig_item is present, we can infer missing generators from gens based on the signature representation of the function.

In the case where property is a built-in property of this ppx, we can perform 2 checks:

  • Check that the number of generator is correct.
  • TODO: Check that the infered generators respect the property's type.