module Solutions.P54 (Tree, leaf, tree1, tree2, tree3, tree4) where
import Problems.BinaryTrees
leaf :: a -> Tree a
leaf :: forall a. a -> Tree a
leaf a
x = a -> Tree a -> Tree a -> Tree a
forall a. a -> Tree a -> Tree a -> Tree a
Branch a
x Tree a
forall a. Tree a
Empty Tree a
forall a. Tree a
Empty
tree1 :: Tree Char
tree1 :: Tree Char
tree1 = Char -> Tree Char -> Tree Char -> Tree Char
forall a. a -> Tree a -> Tree a -> Tree a
Branch Char
'a' (Char -> Tree Char -> Tree Char -> Tree Char
forall a. a -> Tree a -> Tree a -> Tree a
Branch Char
'b' (Char -> Tree Char
forall a. a -> Tree a
leaf Char
'd') (Char -> Tree Char
forall a. a -> Tree a
leaf Char
'e'))
(Char -> Tree Char -> Tree Char -> Tree Char
forall a. a -> Tree a -> Tree a -> Tree a
Branch Char
'c' Tree Char
forall a. Tree a
Empty (Char -> Tree Char -> Tree Char -> Tree Char
forall a. a -> Tree a -> Tree a -> Tree a
Branch Char
'f' (Char -> Tree Char
forall a. a -> Tree a
leaf Char
'g') Tree Char
forall a. Tree a
Empty))
tree2 :: Tree Char
tree2 :: Tree Char
tree2 = Char -> Tree Char
forall a. a -> Tree a
leaf Char
'a'
tree3 :: Tree Char
tree3 :: Tree Char
tree3 = Tree Char
forall a. Tree a
Empty
tree4 :: Tree Int
tree4 :: Tree Int
tree4 = Int -> Tree Int -> Tree Int -> Tree Int
forall a. a -> Tree a -> Tree a -> Tree a
Branch Int
1 (Int -> Tree Int -> Tree Int -> Tree Int
forall a. a -> Tree a -> Tree a -> Tree a
Branch Int
2 Tree Int
forall a. Tree a
Empty (Int -> Tree Int
forall a. a -> Tree a
leaf Int
4)) (Int -> Tree Int
forall a. a -> Tree a
leaf Int
2)