filepath
filepath copied to clipboard
Haskell FilePath core library
Closes #73 Implementation draft to get the discussion started.
Fixes #53 Instead of parsing into a list of lexemes, we defined an ABNF grammar and try to parse directly into it.
Relevant: https://github.com/haskell/filepath/issues/49
At the risk that this will turn into a rant... When migrating form GHC 9.8.1 to 9.8.2 I'm confronted with: ``` Deprecated: Use System.OsString from os-string >= 2.0.0 package instead....
Reproduction steps: 1. Go to https://hackage.haskell.org/package/filepath-1.5.2.0 2. Press 's' to search for something, say `takeDirectory`. 3. Click on one of the results. 4. Get 404 because the URL is https://hackage.haskell.org/package/filepath-1.5.2.0/docs//package/template-haskell-2.19.0.0/docs/System-FilePath-Posix.html#v:takeDirectory
Currently Windows.equalFilePath is case-insensitive and Posix.equalFilePath is case-sensitive. I think we also need case-insensitive Posix.equalFilePath for MacOS and then we should maybe also have case-sensitive Windows.equalFilePath for completeness.
Additionally to `equalFilePath` we also need `compareFilePath` for sorting the contents of a directory and for `Posix` we need a case-sensitive and a case-insensitive version for Linux and MacOS, respectively.
Can you please clarify, how to transfer `FilePath`s from `getEnv`, `GetOpt`, `optparse-applicative` without the roundtrip via `String`?
https://github.com/haskell/tar/pull/88 introduces ```haskell -- | We assume UTF-8 on posix and UTF-16 on windows. toWindowsPath :: MonadThrow m => PosixPath -> m WindowsPath toWindowsPath posix = do str WindowsPath ->...