use intercalate instead of MissingH's join
The two functions are identical.
This commit is contained in:
parent
689bdae03a
commit
04e150abb3
4 changed files with 8 additions and 6 deletions
|
@ -89,7 +89,7 @@ parentDir = takeDirectory . dropTrailingPathSeparator
|
|||
upFrom :: FilePath -> Maybe FilePath
|
||||
upFrom dir
|
||||
| length dirs < 2 = Nothing
|
||||
| otherwise = Just $ joinDrive drive (join s $ init dirs)
|
||||
| otherwise = Just $ joinDrive drive (intercalate s $ init dirs)
|
||||
where
|
||||
-- on Unix, the drive will be "/" when the dir is absolute, otherwise ""
|
||||
(drive, path) = splitDrive dir
|
||||
|
@ -149,7 +149,7 @@ relPathDirToFile from to = relPathDirToFileAbs <$> absPath from <*> absPath to
|
|||
relPathDirToFileAbs :: FilePath -> FilePath -> FilePath
|
||||
relPathDirToFileAbs from to
|
||||
| takeDrive from /= takeDrive to = to
|
||||
| otherwise = join s $ dotdots ++ uncommon
|
||||
| otherwise = intercalate s $ dotdots ++ uncommon
|
||||
where
|
||||
s = [pathSeparator]
|
||||
pfrom = split s from
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue