let subtree = fun d_tree -> fun i -> match d_tree with | End d -> raise (Beam_Matching_Error "Subtree left absent.") | Tree (d, branches) -> ( match branches with (left, right) -> if i = 0 then left else right)