-- refute returns the number of tests generated, not the number of *valid*
-- tests generated, so we count the number of valid tests ourselves
depthCheckResult :: Testable a => Int -> Int -> a -> IO Int
depthCheckResult d n p =
  do writeIORef validCounter n
     refute (run (const p) 0 d) `catch` \() -> return n
     (n-) <$> readIORef validCounter
depthCheckResult :: Testable a => Int -> Int -> a -> IO Int
depthCheckResult d n p =
  do writeIORef validCounter n
     refute (run (const p) 0 d) `catch` \() -> return n
     (n-) <$> readIORef validCounter
depthCheckResult d n p =
  do writeIORef validCounter n
     refute (run (const p) 0 d) `catch` \() -> return n
     (n-) <$> readIORef validCounter