Open c-cube opened 9 years ago
I don't think Random will do for even the common case, since types will typically embed elementary types, at least int
. Both Random.State.int
and Random.State.float
have the wrong signatures. So, for out-of-the-box usage, it would be necessary to ship a library with it.
That raises the question of which distributions to use. Bool is obvious, but int
and float
I think should have distributions centred around 0 with exponential tails. The main use cases I've had in mind are unit testing, generic algorithms, and maybe games. For unit testing, such default distributions might be okay, but for the latter two, I think one want's customized and parametrised distributions. I've though about adding a distribution library, but have been busy with another project since I wrote ppx_deriving_random
. Should have some more time later this autumn, though.
I generally prefer separate packaging when there is not compelling reason to bundle. Not sure deriving random is as generally useful as the shipped deriving modules. Well, except if people start using it for unit testing.
Did you consider merging your work into
ppx_deriving
? You don't seem to need additional dependencies, and the plugin seems general purpose. It might require usingRandom.State.t
by default for therandom_state
, but I think 99% of the use cases will useRandom
anyway.