System.FilePath.splitFileName

Christian Maeder Christian.Maeder at dfki.de
Wed Jan 15 14:42:32 UTC 2014


Hi,

I suggest to improve the documentation for System.FilePath.splitFileName.

The sentence "combine is the inverse" (of splitFileName) is misleading, 
as the following example shows:

Prelude System.FilePath> uncurry combine $ splitFileName "bob"
"./bob"

adding normalize to the result only also gives not (String) identity:
Prelude System.FilePath> normalise $ uncurry combine $ splitFileName "./bob"
"bob"

I suggest to change it to:
"combine is the inverse modulo normalise or equalFilePath"

Maybe also the following combine examples should be added:
   combine "./" "bob" == "./bob"
   combine "." "bob" == "./bob"

http://www.haskell.org/ghc/docs/latest/html/libraries/filepath-1.3.0.1/System-FilePath-Posix.html#g:5

Cheers Christian


More information about the Libraries mailing list