( Tree a ) ( Tree a ) deriving (Show, Read , Eq) singleton : : a → Tree a singleton x = Node x EmptyTree EmptyTree t r e e I n s e r t : : (Ord a ) ⇒ a → Tree a → Tree a t r e e I n s e r t x EmptyTree = singleton x t r e e I n s e r t x (Node a l e f t right ) | x == a = Node x l e f t right | x < a = Node a ( t r e e I n s e r t x l e f t ) right | x > a = Node a l e f t ( t r e e I n s e r t x right )