let rec fold f acc trie = match trie with | Empty -> acc | Full v -> f acc v | Node l -> List.fold_left (fun acc (_,t) -> fold f acc t) acc l