Open lehins opened 3 years ago
What's the rationale for having StatefulGen QC Gen
and not StatefulGen QCGen Gen
?
What's the rationale for having
StatefulGen QC Gen
and notStatefulGen QCGen Gen
?
Never mind, looking closer at the StatefulGen
interface I get it now.
This is a preliminary PR to see if this functionality is even desired. In case that maintainers will see this as useful addition I can add some haddock and examples. Also
QC
was just the very first thing that came to mind, it can be renamed to something totally different.This small change allows to use all of the stateful interface from new version of
>= random-1.2.0
directly from within theGen
monad. For example:Generate anything with instance
Uniform
Generate anything with instance
UniformRange
Use other custom functions that generate random data:
Efficient generation of binary blobs:
Of course, instead of exporting
QC
we could just create specialized functions, i.e.uniform :: Uniform a => Gen a
etc. but that is less useful IMHO, because it would prevent usage of other general functions that people could write forStatefulGen g m