Tree examples for assignment 4

This page has some examples of trees built using the Branch and Leaf constructors specified in assignment 4.

This is the result of applying succ to each leaf of the previous tree.

This is a tree containing some strings.

Generating figures

You don’t necessarily need to look at this section, but I’ll describe what it does in case you’re curious. The function graphviz takes a tree and converts it into a string in a language called GraphViz that can then be fed to a command-line tool to produce images. All the diagrams of trees on this page were produced from this Haskell program and GraphViz.

Used in some tests: