Skip to content

Commit 9bd9092

Browse files
committed
Document relation between joinPath and (</>)
Fixes #82
1 parent 7c9b722 commit 9bd9092

File tree

5 files changed

+6
-1
lines changed

5 files changed

+6
-1
lines changed

Generate.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ qualify pw str
8686
| otherwise = str
8787
where
8888
prelude = ["elem","uncurry","snd","fst","not","null","if","then","else"
89-
,"True","False","Just","Nothing","fromJust","concat","isPrefixOf","isSuffixOf","any"]
89+
,"True","False","Just","Nothing","fromJust","concat","isPrefixOf","isSuffixOf","any","foldr"]
9090
fpops = ["</>","<.>","-<.>"]
9191

9292

System/FilePath/Internal.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -747,6 +747,7 @@ splitDirectories = map dropTrailingPathSeparator . splitPath
747747

748748
-- | Join path elements back together.
749749
--
750+
-- > joinPath a == foldr (</>) "" a
750751
-- > joinPath ["/","directory/","file.ext"] == "/directory/file.ext"
751752
-- > Valid x => joinPath (splitPath x) == x
752753
-- > joinPath [] == ""

System/FilePath/Posix.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -747,6 +747,7 @@ splitDirectories = map dropTrailingPathSeparator . splitPath
747747

748748
-- | Join path elements back together.
749749
--
750+
-- > joinPath a == foldr (</>) "" a
750751
-- > joinPath ["/","directory/","file.ext"] == "/directory/file.ext"
751752
-- > Valid x => joinPath (splitPath x) == x
752753
-- > joinPath [] == ""

System/FilePath/Windows.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -747,6 +747,7 @@ splitDirectories = map dropTrailingPathSeparator . splitPath
747747

748748
-- | Join path elements back together.
749749
--
750+
-- > joinPath a == foldr (</>) "" a
750751
-- > joinPath ["/","directory/","file.ext"] == "/directory/file.ext"
751752
-- > Valid x => joinPath (splitPath x) == x
752753
-- > joinPath [] == ""

tests/TestGen.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,8 @@ tests =
346346
,("W.splitDirectories \"C:\\\\test\\\\\\\\\\\\file\" == [\"C:\\\\\", \"test\", \"file\"]", property $ W.splitDirectories "C:\\test\\\\\\file" == ["C:\\", "test", "file"])
347347
,("P.splitDirectories \"/test///file\" == [\"/\", \"test\", \"file\"]", property $ P.splitDirectories "/test///file" == ["/", "test", "file"])
348348
,("W.splitDirectories \"/test///file\" == [\"/\", \"test\", \"file\"]", property $ W.splitDirectories "/test///file" == ["/", "test", "file"])
349+
,("P.joinPath a == foldr (P.</>) \"\" a", property $ \a -> P.joinPath a == foldr (P.</>) "" a)
350+
,("W.joinPath a == foldr (W.</>) \"\" a", property $ \a -> W.joinPath a == foldr (W.</>) "" a)
349351
,("P.joinPath [\"/\", \"directory/\", \"file.ext\"] == \"/directory/file.ext\"", property $ P.joinPath ["/", "directory/", "file.ext"] == "/directory/file.ext")
350352
,("W.joinPath [\"/\", \"directory/\", \"file.ext\"] == \"/directory/file.ext\"", property $ W.joinPath ["/", "directory/", "file.ext"] == "/directory/file.ext")
351353
,("P.joinPath (P.splitPath x) == x", property $ \(QFilePathValidP x) -> P.joinPath (P.splitPath x) == x)

0 commit comments

Comments
 (0)