
22 Aug
2012
22 Aug
'12
7:38 a.m.
Hello Christopher,
But do you think you could provide a more "real world" example of an application of the "Holy Trinity" ideas?
A commonly cited real-world example that illustrates the first key idea (recursive data type) is a binary tree: data Tree = Node String Tree Tree | Leaf The elements of this data type include: Leaf Node "Root" Leaf Leaf Node "Root" (Node "Left" Leaf Leaf) (Node "Right" Leaf Leaf) And so forth. Common functions on this data type include insertions, deletions, traversal. I am not sure if there is a use for the infinite value of this data type. /Roger