stedolan / crowbar

Property fuzzing for OCaml
MIT License
180 stars 31 forks source link

Shuffled list generator #48

Closed NathanReb closed 4 years ago

NathanReb commented 5 years ago

Would you consider adding a:

val shuffle : 'a list -> 'a list gen

to crowbar? I have a use case for it and I think it could be a worthy addition generally speaking.

I'm happy to contribute if you feel like it should be part of the library!

stedolan commented 5 years ago

That does sound useful! I don't have time to work on it right now, but PRs welcome. (If you're unsure how, I think a good way of doing it is this algorithm using Crowbar.range to pick the numbers.)

NathanReb commented 5 years ago

Yeah that's what I used in the end to shuffle my lists. I'll give it a go!

NathanReb commented 5 years ago

Hmm thought I added a mention to automatically close this in #50. I guess this can be closed now!