Skip to content

Instantly share code, notes, and snippets.

@deque-blog
Last active February 10, 2017 12:25
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/7e24f715cbbc748964b2a5b546de9475 to your computer and use it in GitHub Desktop.
Save deque-blog/7e24f715cbbc748964b2a5b546de9475 to your computer and use it in GitHub Desktop.
buildTree :: Shrink a -> a -> Tree a
buildTree shrinker = build where
build x = Tree x (map build (shrinker x))
addCounterExample :: (Show a) => a -> Tree Result -> Tree Result
addCounterExample arg = fmap (\r -> overFailure r addToFailure)
where addToFailure f = f { counterExample = show arg : counterExample f }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment