Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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