c-cube / qcheck

QuickCheck inspired property-based testing for OCaml.
https://c-cube.github.io/qcheck/
BSD 2-Clause "Simplified" License
347 stars 36 forks source link

Split code in different files #113

Open sir4ur0n opened 3 years ago

sir4ur0n commented 3 years ago

While reworking documentation as part of https://github.com/c-cube/qcheck/pull/109 I noticed that having the whole interface in a single file has several drawbacks:

At the very least I would imagine having a file for each module Test / TestResult / Gen / Tree / Shrink / Print / Fn / etc. (and there probably is a need to create a QCheck_internal to store all top level types and functions like arbitrary to be able to also change the declaration order for these)

c-cube commented 3 years ago

You can also declare, at the top of the mli, all types (opaque if needed); then list the submodules in the order that makes the most sense, binding type t = the_toplevel_forward_declaration. This way there is no need for a internal module.