From bf0bb2d35b145fa6556993c2f745edfa73a977d7 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Sun, 25 Dec 2016 12:06:30 +0700 Subject: Add Vytree.children_of_path : 'a t -> string list function as a convenient shortcut for getting children of a non-root node --- src/vytree.ml | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/vytree.ml') diff --git a/src/vytree.ml b/src/vytree.ml index 38f7570..0e379ee 100644 --- a/src/vytree.ml +++ b/src/vytree.ml @@ -123,3 +123,7 @@ let get_existent_path node path = | None -> acc | Some c -> aux c names (name :: acc) in List.rev (aux node path []) + +let children_of_path node path = + let node' = get node path in + list_children node' -- cgit v1.2.3