-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support AbstractFilePath
#192
Conversation
Suppresses redundant patterns warnings.
Wrt aeson, also see: Can you point me to the places where you use I'm on my phone and PR reviews are hard. Generally, we shouldn't need to ever assume an encoding. Using |
@NorfairKing Well, there is a way to relax the version bounds of filepath/os-string to include I am working on (internal) compatibility modules to work around that right now. |
Turns out there were some more functions missing; See compat/System/OsString/Compat/Include.hs. I added a flag @NorfairKing Can you check again if that works for you too? (Since I am not a Nix user I am particularly interested if it works with that setup.) |
@mmhat now I'm seeing this:
When trying to build with this path with:
We're getting closer though! |
There's a typo : Which resolver are you using? |
Ah that was a copy-paste error, I had it right in my source code.
lts-22.22, the latest stable release of nixos. |
@NorfairKing I added a
Yeah, that would be great. I am not sure why one has to set flags explicitly, but I suspect that Stack solves dependencies without trying to toggle flags? TBH, I have no idea how to work around this issue... |
@mmhat for least annoyance, we need to make sure that Right now I still see this when trying to upgrade only path on a 22.22 project:
Here's another project:
You can try it out by adding If we can't make this backward compatible then we may have to make this PR should a separate package so that we definitely don't break anyone downstream. Edit: This feels like a conversation that would be better suited to a medium with more bandwidth. I want to be respectful of your work as well as downstream dependents. |
@NorfairKing I managed to make the changes backwards compatible to a certain degree; I think this as good as it can get.
Adding the following to - Cabal-3.10.3.0@sha256:4a36954a66769eef90353daa0dbb07d43e49c228281383c7e4134445d495f714,12313
- Cabal-syntax-3.10.3.0@sha256:c2ca36499bf9365726968b1e11a757e6d846c47cdf0c2c26a003698fd3c300fe,7431
- directory-1.3.8.5@sha256:fbeec9ec346e5272167f63dcb86af513b457a7b9fc36dc818e4c7b81608d612b,3166
- filepath-1.4.300.2@sha256:345cbb1afe414a09e47737e4d14cbd51891a734e67c0ef3d77a1439518bb81e8,5900
- process-1.6.21.0@sha256:685bc68759da31b5f152092fe664e1644e84f6dc0ae7a6c143e8564a1d6dafe8,2644
- unix-2.8.5.1@sha256:3f702a252a313a7bcb56e3908a14e7f9f1b40e41b7bdc8ae8a9605a1a8686f06,9808 There is unfortunately no way to drop the
Yeah, I know; I myself use Is there anything left I can do to improve this PR? |
I'm replying asap to that you know I care about getting this merged, but can't review tonight. |
@mmhat I left two more little comments. After that I think it's ready to squash, merge, and release. I think I'll be around tonight to get it in, and next otherwise next week :) |
@NorfairKing Ok, this can be merged. Thank you very much for maintaining this library! |
Merged and released as |
I can't tell why this is not being marked as merged so I will close it manually. |
This PR adds a new namespace
OsPath
to the library which contains a version ofPath
that is a newtype wrapper around theSystem.OsPath
filepaths. As a consequence all functions that took aFilePath
as an argument or produced on, or that took/produced aString
(e.g. extensions) now use the counterparts fromSystem.OsPath
andSystem.OsString
respectively.toFilePath
is an exception to this, it still gives you aSystem.FilePath.FilePath
.For the implementation I aimed to stay as close to the existing
Path
modules as possible, that's why there are for example also ports of the deprecated functions included.As it stands this PR consists of two parts: The first commits are cleanup/refactoring commits of the code that already exists.
Those happened either because something was missing (
hie.yaml
) or something got in my way (.ghci.conf
) or - the biggest part - as a preliminary work before the replication of the various modules. For example, I refactored thetest
testsuite such that the copy could be easier adapted to the newOsPath
hierarchy.There are some ugly parts where I am not entirely sure if I found the right solution - in particular the
aeson
instances and everything involving conversion from one encoding to another, where I had to useunsafeDupablePerformIO
at some places.Gently pinging @hasufell @mpilgrem (I noticed to late that you started working on this issue too) and @NorfairKing since I am interested in your feedback specifically.
Fixes #189