Created
July 29, 2014 15:08
-
-
Save toroidal-code/7c446e4538b5fa2c887a to your computer and use it in GitHub Desktop.
Revisions
-
toroidal-code created this gist
Jul 29, 2014 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ type 'a btree = | Leaf of 'a | Branch of ('a btree) * ('a btree) let rec flatten = function | Leaf(a) -> [a] | Branch(r, l) -> flatten r @ flatten l let _ = Branch(Leaf "a", Branch(Leaf "b", Leaf "c")) |> flatten |> List.iter (Printf.printf "%s ") ;