Tree-to-SML

This tree-to-text converter will fit the datatype:

datatype 'a tree =
  Empty
| Node of 'a tree * 'a * 'a tree

Shrub-to-SML

This shrub-to-text converter will fit the datatype:

datatype 'a shrub = Empty
| Leaf of 'a
| Branch of 'a shrub * 'a shrub

Rose-to-SML

This rose-to-text converter will fit the datatype:

datatype 'a rose =
  Rose of 'a * 'a rose list

SML-to-Tree

This text-to-tree converter will fit the datatype:

datatype 'a tree = Empty
| Node of 'a tree * 'a * 'a tree

1. Depth:



2. Enter node values:

3. Copy and paste the text below:

~SML Text will appear here~

Note: only nodes with non-empty parents (aka a valid path to the root) will appear in the output.
Leave values blank to generate an unbalanced tree/shrub.

1. Enter SML Text:



2. View your tree below:

Note: does not work if parentheses or commas are enclosed in quotes.
Empty nodes not shown.