d04a0b2d

Created Started Cancelled

By: Tom Sydney Kerckhove <syd@cs-syd.eu>

Use path and path-io rather than filepath and directory

Nothing here was doing string surgery on paths on purpose; it was doing it
because `</>` and `takeBaseName` were what came to hand. The types now say
which paths are absolute, which are relative, and which are directories, and
`FilePath` survives only where diagnose asks for one to name a file in a
report.

Two things came out of it. `getCurrentDirectory` with `makeRelative` silently
returned the absolute path when the file was elsewhere; `stripProperPrefix`
returns Nothing, so that case is now a decision rather than a coincidence.
And `setFileExtension` is deprecated in favour of `replaceExtension`, which
unlike its predecessor refuses an empty extension, so the stem of a filename
comes from `splitExtension`.

`bytestring` went too: reading the hosts file is `eitherDecodeFileStrict`
rather than a `readFile` and a decode.
GitHub