This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // the trick: | |
| // each node must be connected directly to its direct children (with visible characters) | |
| // and indirectly (through indentation) to its children's descendants | |
| type Tree<'a> = | |
| | Leaf of 'a | |
| | Branch of 'a * list<Tree<'a>> | |
| let printTree (t: Tree<'a>) = | |
| let connectIndent (isLast: bool) (child: string, grandChild: string list) = |