Proposal: Add System.FilePath to base

Neil Mitchell ndmitchell at
Wed Nov 22 13:23:38 EST 2006


> > What, then, is the result of (addExtension "/" "x")? What, in general, is
> > the behavior in case the first argument ends with a path separator?

Properties added:
 addExtension "/" "x" == "/.x"
 takeBaseName (addExtension (asDirectory x) "ext") == ".ext"

> | 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."

 takeBaseName "" == ""
 takeBaseName "test" == "test"
 takeBaseName (asDirectory x) == ""

Hopefully this makes things a bit clearer.

Thanks for the comments


More information about the Libraries mailing list