Skip to content

Instantly share code, notes, and snippets.

@deque-blog
Created December 23, 2016 21:23
Show Gist options
  • Save deque-blog/a920ff1bbcfa3855c26a9cb66ce97518 to your computer and use it in GitHub Desktop.
Save deque-blog/a920ff1bbcfa3855c26a9cb66ce97518 to your computer and use it in GitHub Desktop.
treeWalkR :: Tree a -> [a]
treeWalkR EmptyTree = []
treeWalkR (Tree root) = treeWalkR' root
treeWalkR' :: Node a -> [a]
treeWalkR' (Node v children) = v : concatMap treeWalkR' children
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment