These two playlists are the most efficient way to get into functional programming/category theory. Also suggest Richard Bird's books.Thank you so much Prof.
Isnt the definition on 44:34 of Tree wrong? I think it has to defined like this: Data Tree a = Nil | Node a (Tree a) (Tree a). Because otherwise Node (Leaf 4) (Leaf 3) would be a valid tree.
There are lots of different kinds of tree types. In this case we are defining binary trees with labels in the leaves, so the definition is correct. Your definition is for binary trees with labels in the nodes. Hope this helps!
These two playlists are the most efficient way to get into functional programming/category theory. Also suggest Richard Bird's books.Thank you so much Prof.
Isnt the definition on 44:34 of Tree wrong? I think it has to defined like this: Data Tree a = Nil | Node a (Tree a) (Tree a). Because otherwise Node (Leaf 4) (Leaf 3) would be a valid tree.
There are lots of different kinds of tree types. In this case we are defining binary trees with labels in the leaves, so the definition is correct. Your definition is for binary trees with labels in the nodes. Hope this helps!
🐐