santiweight / poker-base

BSD 3-Clause "New" or "Revised" License
4 stars 0 forks source link

Random + Arbitrary instances #33

Closed tonyday567 closed 3 years ago

tonyday567 commented 3 years ago

For any property testing, we're going to need Arbitrary instances.

I also think dealing cards is in scope for base, and shouldn't attract opinion variance.

santiweight commented 3 years ago

Added quickcheck: https://github.com/santiweight/poker-base/pull/34

santiweight commented 3 years ago

Is there a no-opinions random package?

santiweight commented 3 years ago

I know about https://hackage.haskell.org/package/random-1.2.1

But I don't follow the random ecosystem, so I'll defer to your knowledge. I do know that random is fully maintained nowadays

tonyday567 commented 3 years ago

Random.System is all we need. You end up with a bit of State boiler-plate, but it's nice to work with.

santiweight commented 3 years ago

Just a note - it's quite obvious, but I made the mistake once - be sure not to generate non-normalised values for Hole/ShapedHole in the Arbitrary instance.

I think Random can wait - a good first issue to let people into the library...

santiweight commented 3 years ago

Closing in favour of #54