Deriving adversarial samplers from encodings
It would be extremely useful to have the following functions
val sample : 'a Data_encoding.t -> Random.State.t -> 'a
val sample_encoding : Random.State.t -> Data_encoding.ex
val sample_binary : 'a Binary_schema.t -> string
where Data_encoding.ex
is an existentially packed encoding.
sample
could be used to write fuzzers, sample_encoding
could be use to fuzz data-encoding itself and sample_binary
would allow to generate directly random well-formed and probably atypical binary encodings.