haskell-checkers/checkers

MonadFix

Opened this issue · 4 comments

In my experience with Data.Sequence and especially Data.Tree, I have learned that it is extremely difficult to test that a MonadFix instance obeys the laws. It also tends to be very difficult to prove that the laws hold. It would therefore be very helpful if checkers could provide some assistance. It's tricky because the functions passed to mfix need to be lazy, and their detailed strictness needs to be reflected in certain ways in the results of mfix. I suspect the right approach is to find a way to generate some reasonably large but very well-behaved class of functions, probably with some help from the user.

conal commented

Thanks for the suggestion and insights. I'm unlikely to take initiative on this issue, but maybe someone else will.

Note that there's some relevant work in progress at andrewthad/quickcheck-classes#87.

Yes, this has proven to be extremely difficult, in both quickcheck-classes and hedgehog-classes.

I think this paper has some relevant ideas: https://very.science/pdf/StrictCheck.pdf