Refactor isValid and makeValid
authorThomas Miedema <thomasmiedema@gmail.com>
Tue, 28 Oct 2014 18:16:52 +0000 (19:16 +0100)
committerThomas Miedema <thomasmiedema@gmail.com>
Tue, 28 Oct 2014 18:49:46 +0000 (19:49 +0100)
commit2d37bc25735bd658358092ff2209ef3abcf35160
tree5976d27052fba2bd6b2d3948f77238c0d61f932d
parentf3c268f3f736ea7b74b3d3337114e3d8aa67f9ae
Refactor isValid and makeValid

`head (splitPath path)` is not equal to `takeDrive path` in general:

    head (splitPath "\\foo") == "\\"
    fst (splitDrive "\\foo") == ""

We can do this refactoring because they /are/ equal within the
constraint:

    `length drv >= 2 && all isPathSeparator drv`
System/FilePath/Internal.hs