Open sir4ur0n opened 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.
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:
Test
I think thatt
andmake
are the most important bits (and thus should be the first presented to the user) but because of MLI typechecking,cell
must be put first. There are plenty of other similar problems, e.g. having to presentTree
andShrink
beforeGen
whileGen
is arguably the most important moduleAt 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 likearbitrary
to be able to also change the declaration order for these)