Last active
December 20, 2015 04:58
-
-
Save bpatra/6074329 to your computer and use it in GitHub Desktop.
Using the mutable tree and its mergeInto function introduced ingist:6074217
This file contains 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
let tree = ref Tree.Empty | |
let branch1 = ["a";"b";"c"] | |
let branch2 = ["a";"b";"d"] | |
let branch3 = ["a";"f"] | |
do mergeInto tree branch1 | |
do mergeInto tree branch2 | |
do mergeInto tree branch3 | |
//the following tree is created | |
// a | |
// / \ | |
// f b | |
// / \ | |
// d c |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment