Proposal: System.FilePath: current directory should be ".", not ""

Duncan Coutts duncan.coutts at
Wed Nov 4 06:11:49 EST 2009

On Wed, 2009-11-04 at 10:00 +0000, Simon Marlow wrote:

> I've amended the patch as suggested above, it turned out to be not too 
> hard.


> Neil's comprehensive test suite still passes with the new patch.
> Ticket, with new patch attached:
> The discussion deadline has long passed, so I propose we have another 2 
> weeks (18 November).

I support this new proposal.

To summarise for people who have not been paying full attention:

        takeDirectory "Main.hs"  =  ""
        takeDirectory "Main.hs"  =  "./"

The purpose being that one can always take the directory and get a valid
path to use with a file system function, eg createDirectory. 

Unchanged behaviour:

        "./" </> "Main.hs"  =  "./Main.hs"

It was initially proposed that </> eat "./" on the left hand side but
the current proposal leaves the behaviour of </> unchanged.


More information about the Libraries mailing list