Open treeowl opened 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.
For example, we should generally be using
===
for equality testing and.&&.
for property conjunction, instead of just usingBool
. This sort of thing should give us better error messages when tests fail.