witchcrafters / type_class

(Semi-)principled type classes for Elixir
https://hex.pm/packages/type_class
MIT License
140 stars 16 forks source link

Clarification regarding generators #44

Open cognivore opened 2 years ago

cognivore commented 2 years ago

Oddly enough, both generators in the documentations and the generator I've seen in Maybe are ignoring their argument and use Enum.random().

This seems to be an anti-pattern in property-based testing because it relies on reproducibility of a random test that caught an error.

I assume that the underlying plumbing somehow sets a global seed for Enum.random(), perhaps mix test even does it itself (hence "Randomized with seed NNN" messages at the end of the tests), but in my opinion a clarification is required here.

github-actions[bot] commented 2 years ago

Thank you for submitting an issue! It means a lot that you took the time -- it helps us be better 🙏