
22 Nov
2006
22 Nov
'06
5:14 p.m.
Benjamin Franksen wrote:
What, then, is the result of (addExtension "/" "x")? What, in general, is the behavior in case the first argument ends with a path separator?
Another example where the semantics is unclear (to me) is
takeBaseName :: FilePath -> String Source Get the base name, without an extension or path. takeBaseName "file/test.txt" == "test" takeBaseName "dave.ext" == "dave"
What is (takeBaseName "dir.ext/")? "dir"? Or ""? A general principle that would clarify this could be "An extension of a file path is always a suffix of the file path. It never contains a path (directory) separator." Ben