Ocaml list to tree
问题 I want to write a function load: 'a option list -> 'a tree , that restores binary tree from the given list, which contains the elements in postfix order. If the list does not represent any tree, your function should raise the exception Load (you have to declare it earlier). The tree is defined as : type ‘a btree = L of ‘a | N of ‘a btree * ‘a btree So far what I did was : exception Load ;; let rec load l = match l with | [] -> raise Load | Some x::_ -> L x | None::t -> N(?,load t) ;; Here's