1 2 3 4 5 6 7 8
import Tree completeBinaryTree n = makeTree 1 where makeTree x | x > n = Empty | otherwise = Branch 'x' (makeTree (2*x)) (makeTree (2*x+1)) isCompleteBinaryTree