0

I have the follow two functions:

leftPoint :: Point -> Board -> Point
rightPoint :: Point -> Board -> Point

It should have the propoerty:

rightPoint (leftPoint p b) b == p

Or in English: the right point of a point's left point is itself.

My test failed with a case but I'd like to run through the test in a step by step way to understand it. Does Haskell or QuickCheck library provide such a debugging tool?

McBear Holden
  • 805
  • 4
  • 14
  • Should `rightPoint (leftPoint p b) b == p`? Now you basically say that the right point of the left point of `p` is the left point of `p`? – Willem Van Onsem Dec 14 '19 at 16:44
  • @WillemVanOnsem thanks for point this out.my bad, it's a typo. In my program it's correct without this typo. – McBear Holden Dec 14 '19 at 16:49
  • QuickCheck will usually report the value(s) that caused the property to be falsified. Doesn't it do that for you? – Mark Seemann Dec 14 '19 at 17:06
  • @MarkSeemann it does and it certainly helps. but sitll I prefer to see the exact failure location. – McBear Holden Dec 14 '19 at 17:08
  • If Haskell comes with a debugger that enables you step through code, I'm not aware of it. I usually troubleshoot Haskell code like this: https://stackoverflow.com/a/48222438/126014 – Mark Seemann Dec 14 '19 at 17:20

0 Answers0