-
Notifications
You must be signed in to change notification settings - Fork 0
Add AFPP blog #4
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
Conversation
7525c03 to
69fdaa1
Compare
Bodigrim
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! I left some minor remarks.
| I'm pleased to announce that the Haskell type `type FilePath = String` | ||
| has a successor, which was first discussed many years ago as the [Abstract FilePath proposal (AFPP)](https://gitlab.haskell.org/ghc/ghc/-/wikis/proposal/abstract-file-path). | ||
|
|
||
| The new type shipped with the [filepath-1.4.99.0](https://hackage.haskell.org/package/filepath-1.4.99.0/candidate) package is (simplified, omitting some type aliases): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the rationale to distinguish OsString and type OsPath = OsString? Could we just define OsPath as below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some parts of the filepath API deal with things that are not really filepaths, e.g. https://hackage.haskell.org/package/filepath-1.4.2.2/docs/System-FilePath.html#v:splitSearchPath
splitSearchPath :: String -> [FilePath]So we want to maintain that light distinction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dunno, if it's worth it. Type synonyms may cause confusing error messages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've sent this for discussion to the CLC long ago, but never got an answer.
After some discussions with users on IRC i decided to keep the type synonym.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd certainly prefer no type synonyms, but up to you. Might be worth to elaborate on this decision in the blog post.
|
|
||
| So, you can just: | ||
|
|
||
| 1. update your dependencies lower bounds to the minimum version that supports `OsPath` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good place to give some examples, e. g., filepath >= 1.4.99, unix >= 2.8, Win32 >= 2.14 or whatever.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, need to wait for releases to know which versions exactly.
@Bodigrim
Rendered markdown: https://github.com/hasufell/hasufell.github.io/blob/AFPP/posts/2022-06-29-fixing-haskell-filepaths.md
TODO: