findTree :: (a -> Bool) -> Tree a -> Maybe (Tree a)
-- | keep only the elements that match the provided condition
filter :: (a -> Bool) -> Tree a -> Tree a
The 'Tree' is appended in the name, to distinguish from the Foldable instances, that return the value, and not a sub-tree.
Additionally, the following two functions might also be useful (even if the implementation is very simple in the second case):
-- | get the sub-tree for the specified node value in the first tree in
-- forest in which it occurs.
lookupTreeInForest :: Eq a => a -> [Tree a] -> Maybe (Tree a)
-- | Length of the tree
length :: Tree a -> Int
There are probably more useful functions to add, so suggestions are welcomed.
Discussion period: 2 weeks
Cheers,
Joćo