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

Switch Data.Text.Array to Data.Array.Byte #474

Merged
merged 2 commits into from
Feb 28, 2023

Conversation

Bodigrim
Copy link
Contributor

@Bodigrim Bodigrim commented Oct 2, 2022

This is a part of a grand plan to unify ShortByteString, Data.Text.Array and Data.Primitive.ByteArray to share the same data type. If it looks good, I'll make a release of data-array-byte package.

@phadej
Copy link
Contributor

phadej commented Oct 2, 2022

This is technically a breaking change as Data.Text.Array is just an ordinary public module, with Array being public type.

An example of possible problems: any instances for Data.Text.Array.Array (and Data.Primitive.ByteArray ...)

@Bodigrim
Copy link
Contributor Author

Bodigrim commented Oct 2, 2022

I hoped no one ever defined instances for Data.Text.Array, but https://hackage.haskell.org/package/isomorphism-class-0.1.0.7/docs/IsomorphismClass.html does. Sigh. Well, then a breaking change it is.

@phadej
Copy link
Contributor

phadej commented Oct 2, 2022

I hoped no one ever defined instances for Data.Text.Array

You cannot ever know what (kind of weird stuff) people do in private projects. IMO we cannot assume no-one does anything weird, only that is very rare.

EDIT: PVP is also quite unambiguous, breaking change is breaking change even no-one observes it. Someone might observe it in future by writing instances to ease transition! (though they probably end up needing to use CPP, having CPP-guards at major bounds is definitely more welcome).

@Bodigrim
Copy link
Contributor Author

Bodigrim commented Oct 3, 2022

Perhaps this has to wait until GHC 9.4 becomes a bootstrap version, otherwise I imagine Hadrian might be troubled...

@Bodigrim
Copy link
Contributor Author

Bodigrim commented Oct 8, 2022

Cf. haskell/primitive#359 and haskell/bytestring#410.

This is now pending FreeBSD build investigation in #475.

@Bodigrim Bodigrim force-pushed the bytearray branch 2 times, most recently from 82b2b81 to 65ac808 Compare October 8, 2022 19:40
@Bodigrim
Copy link
Contributor Author

Bodigrim commented Jan 8, 2023

Once GHC 9.6 is released, GHC 9.4 will become the oldest bootstrap compiler. So we are free to merge this right after we cut a release for GHC 9.6, which is fairly soon I hope.

@Ericson2314
Copy link
Contributor

What's the issue with GHC before 9.4? Hadrian is allowed to depend on things on Hackage.

@Bodigrim
Copy link
Contributor Author

This is ready for review now. Both haskell/primitive#359 and haskell/bytestring#410 have been merged.

@Bodigrim Bodigrim merged commit ff4af4c into haskell:master Feb 28, 2023
@Bodigrim Bodigrim deleted the bytearray branch February 28, 2023 18:46
@RyanGlScott
Copy link
Member

Another breaking change that this PR brings about (aside from the discussion about instances in #474 (comment)) is that you will no longer be able to import Array like so:

import Data.Text.Array (Array (..))

The aeson library actually does this—see this code. As a result, aeson no longer builds with the latest text master branch, which is slated to be released with GHC 9.8. (See this failing GHC 9.8 head.hackage CI job.) I only bring this up because the text version is still 2.0.2 (the same version released with GHC 9.6), and it took me a while to figure out what had changed.

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

Successfully merging this pull request may close these issues.

5 participants