Ok so Haskell is now my new interest and I have been reading the Real Work Haskell Book and so far so good. Wrote my first haskell program that I am satisfied with.
data Tree a = Node a (Tree a) (Tree a)
| Empty
deriving (Show)
treeHight Empty = 0
treeHight (Node _ Empty Empty) = 1
treeHight (Node _ x y) = 1 + max (treeHight x) (treeHight y)
One thought on “Haskell Adventures #1”