data Tree a = Nil | Branch (Tree a) a (Tree a) bfs t = [x | Branch _ x _ <- b] where b = t:[x | Branch l _ r <- b, x <- [l,r]]