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

Reduce String/ByteString/PosixString variants #240

Open
hasufell opened this issue Jul 25, 2022 · 10 comments
Open

Reduce String/ByteString/PosixString variants #240

hasufell opened this issue Jul 25, 2022 · 10 comments

Comments

@hasufell
Copy link
Member

hasufell commented Jul 25, 2022

We currently have three variants of many modules. I think we should reduce these.

My idea is:

  1. String is questionable overall, maybe drop it completely in unix-3.x.x.x
  2. merge ByteString and PosixString... use PosixString for filepaths and short data (e.g. GroupEntry/UserEntry maybe) and use ByteString for file contents, lazy IO and other things where we don't know anything about size limits. RawFilePath should be dropped... it's not right.

So, ideally... there would be only one API. String will probably have to live much longer, but it could be debated to move it to a compat package some time in the future.

@hs-viktor @Bodigrim

@Bodigrim
Copy link
Contributor

I do not expect another major version bump after unix-2.8 within a year or two. I'd just wait and see how things unfold wrt string zoo in Haskell and return to this discussion later.

@NicolasT
Copy link
Contributor

Couldn't Backpack help here?

@hasufell
Copy link
Member Author

Couldn't Backpack help here?

I think no one uses that.

@NicolasT
Copy link
Contributor

Couldn't Backpack help here?

I think no one uses that.

Which is a bummer, because it's exactly the kind of functionality (ML-style modules and functors) that would reduce duplication 😄

It looks like Stack and some other non-Cabal build tools don't support it though, hence I guess it's ruled out for a library like unix. Which is a bummer. I may toy with a PoC, just to get familiar with Backpack.

@hasufell
Copy link
Member Author

String discussions seem to be currently quite popular, so we could try to source community opinions.

@phadej
Copy link
Contributor

phadej commented Jul 20, 2024

String is questionable overall, maybe drop it completely in unix-3.x.x.x

I guess that would cascade to e.g. directory? Or will it still have String/FilePath API?

@hasufell
Copy link
Member Author

String is questionable overall, maybe drop it completely in unix-3.x.x.x

I guess that would cascade to e.g. directory? Or will it still have String/FilePath API?

directory already uses OsPath and the whole String API is actually a wrapper layer over the internal OsPath API. So I don't think it really uses filepath/string based unix API anymore.

@phadej
Copy link
Contributor

phadej commented Jul 20, 2024

@hasufell then I don't think many will notice if String interface is dropped. Having a little but not so gentle push to migrate from String interface would be for the good.

@hasufell
Copy link
Member Author

I do not expect another major version bump after unix-2.8 within a year or two. I'd just wait and see how things unfold wrt string zoo in Haskell and return to this discussion later.

How time flies...

I wonder if we can start a deprecation process. Any opinions @Bodigrim @hs-viktor ?

@Bodigrim
Copy link
Contributor

I’m fine to deprecate String-based interface in the next minor release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants