Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
visitResultTree :: Tree Result -> Result
visitResultTree (Tree Success _) = Success
visitResultTree (Tree failure children) =
let simplerFailure = find (isFailure . treeVal) children
in maybe failure visitResultTree simplerFailure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment