Skip to content

Instantly share code, notes, and snippets.

@deque-blog
Created February 2, 2017 12:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deque-blog/ad89cc6208edd9c9b66f2eaccf272de4 to your computer and use it in GitHub Desktop.
Save deque-blog/ad89cc6208edd9c9b66f2eaccf272de4 to your computer and use it in GitHub Desktop.
rapidCheckImpl :: Testable prop => Int -> Int -> prop -> Result
rapidCheckImpl attemptNb startSeed prop = runAll (property prop)
where
runAll prop = foldMap (runOne prop) [startSeed .. startSeed + attemptNb - 1]
runOne prop seed =
let result = runProp prop (mkStdGen seed)
in overFailure result $ \failure -> failure { seed = seed }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment