let append (((kind, segs) as path)) = function | "" | "." -> path | ".." -> raise (Invalid_argument "Filepath.append") | s -> (kind, (segs @ [ s ]))