include Path
let unfold ~fs ~ext:dot_mld path =
let open Path in
if Path.is_directory path then
fs / native_exn path / ("man" ^ dot_mld)
else begin
let x = fs / (native_exn path ^ dot_mld) in
if Path.is_directory x then
fs / (native_exn path ^ dot_mld) / ("man" ^ dot_mld)
else if Path.is_file x then
fs / (native_exn path ^ dot_mld)
else
fs / native_exn path
end