Our phat library defines normalized
rather precisely. The library is overkill for most use cases, but we wrote it for applications that deal heavily with the file system. We'll release to opam soon, but for now you'll have to do a couple of pins. Here is a full working example:
$ opam pin add solvuu_build https://github.com/solvuu/solvuu_build
$ opam pin add phat https://github.com/solvuu/phat.git
$ utop
# #require "phat.pure";;
# module Phat = Phat_pure.Std;;
# Phat.(abs_dir "/a/../b/./c/d/" |> ok_exn |> normalize |> to_string);;
- : string = "/b/c/d"