let rec normalize_list = function | [] -> [] | "." :: xs -> normalize_list xs | ".." :: _ -> failwith "Pathname.normalize_list: .. is forbidden here" | _ :: ".." :: xs -> normalize_list xs | x :: xs -> x :: normalize_list xs