Skip to content
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

Remove typed-paths interface and use FilePath for everything #673

Open
patrickt opened this issue Mar 25, 2022 · 2 comments
Open

Remove typed-paths interface and use FilePath for everything #673

patrickt opened this issue Mar 25, 2022 · 2 comments
Labels
good first issue Good for newcomers help wanted Up for grabs maintenance Incremental improvements

Comments

@patrickt
Copy link
Contributor

patrickt commented Mar 25, 2022

Though FilePath is very flawed, especially on Windows, typed paths were a failed experiment. They did not actually catch any bugs; the best thing they did was expose some very weird behavior in certain functions, ones that we were unable to change (without huge renovations) lest command-line invocations break. There is a new FilePath type coming, one based on ShortByteString and officially blessed by a GHC working group, and we should just switch back to FilePath so that we can transition to that when possible.

@patrickt patrickt added help wanted Up for grabs good first issue Good for newcomers maintenance Incremental improvements labels Mar 25, 2022
@hasufell
Copy link

hasufell commented Apr 1, 2022

My package hpath, which will transition to AbstractFilePath when it rolls out, is a fork of the path package and adds the distinction of absolute/relative only: https://github.com/hasufell/hpath

Right now it only works on bytestring and unix. I have an experimental branch that adds windows support and uses AbstractFilePath: https://github.com/hasufell/hpath/tree/abstract-filepath

It also contains a rather big module with its own IO functions implemented from scratch: https://github.com/hasufell/hpath/blob/abstract-filepath/hpath-io/src/HPath/IO.hs

If you're interested in that approach, I'm open to discuss API. GHCup will switch back to it once all the transitions are ironed out, but it doesn't have any other user afaik.


Edit: I also happen to be the filepath maintainer and the implementor of AFPP.

If you want to test it, check out:

docs:

@robrix
Copy link
Contributor

robrix commented Apr 21, 2022

@hasufell: This is very cool; thank you for sharing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Up for grabs maintenance Incremental improvements
Projects
None yet
Development

No branches or pull requests

3 participants