fileToRoot :: FilePath -> FilePath
fileToRoot p = case joinPath $ replicate (pred $ pathDepth $ splitPath p) ".." of
    "" -> "."
    x -> x
fileToRoot :: FilePath -> FilePath
fileToRoot p = case joinPath $ replicate (pred $ pathDepth $ splitPath p) ".." of
    "" -> "."
    x -> x
fileToRoot p = case joinPath $ replicate (pred $ pathDepth $ splitPath p) ".." of
    "" -> "."
    x -> x