haskell / containers

Assorted concrete container types
https://hackage.haskell.org/package/containers
315 stars 178 forks source link

Use more nice QuickCheck features #263

Open treeowl opened 8 years ago

treeowl commented 8 years ago

For example, we should generally be using === for equality testing and .&&. for property conjunction, instead of just using Bool. This sort of thing should give us better error messages when tests fail.

treeowl commented 8 years ago

I suspect the PropertyM monad transformer may offer a nicer way to deal with validity checks for, e.g., sequences. Instead of using toList', which turns a sequence into a list if it's valid and returns Nothing otherwise, along with a funny ~= operator that compares maybe a value to a value, we could work in PropertyM Identity.

toList' :: Monad m => Seq a -> PropertyM m [a]
(~=) :: (Monad m, Eq a) => PropertyM m a -> PropertyM m a -> Property

-- Example
toList' foo ~= pure bar

Or something like that.