I'll define a data type along the lines you mentioned:
data Tree2 b a = Leaf a | Node b (Tree2 b a) (Tree2 b a)
deriving Show
so I'll be able to use
example :: Tree2 (Integer -> Integer -> Integer) Integer
example = Node (^) (Leaf 2) (Leaf 3)
The most general folding function ("catamorphism") you can make on this type is one which recurses down the structure replacing each constructor (Leaf, Node) with a function (foldLeaf, foldNode):
foldTree2 :: (a -> v) -> (b -> v -> v -> v) -> Tree2 b a -> v
foldTree2 foldLeaf foldNode = fold where
fold (Leaf a) = foldLeaf a
fold (Node b left right)
= foldNode b (fold left) (fold right)
so we should be able to define lots of functions using this, but in particular, the evaluation function you were seeking is
inOrderApply :: Tree2 (a -> a -> a) a -> a
inOrderApply = foldTree2 id id
ghci> inOrderApply example
8
ghci> inOrderApply (Node (+) (Node (-) (Leaf 10) (Leaf 5)) (Node (*) (Leaf 3) (Leaf 2)))
11