-
Notifications
You must be signed in to change notification settings - Fork 16
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
Avoid Lift ByteArray breaking with RebindableSyntax #286
Comments
How did it happen that (I'm not being formal for no reason here: dealing with TH AST all over the |
It happened here: https://gitlab.haskell.org/ghc/ghc/-/commit/228dcae6a0efbe5289add5330c46f581780dd96c I guess the point is that if |
The lack of a CLC proposal was an oversight from me. As you can see it was quite a big MR and I overlooked that this could do with a proposal. I can write one up if you'd like. I'll definitely keep it in mind for the future in any case.
Thats a good point. I think ByteArray is a bit of an exception though. Most instances are just derived ones. |
Yes, please. Also make sure that there are changelog entries and |
See: #287 |
I'm pausing this for now as I'm no longer sure if this is the best fix to the underlying issue. I'll revisit this in a few months |
haskell/text#534 fixes a bug in the
Lift Text
instance namely the way numeric values were lifted meant that in the presence ofRebindableSyntax
, which might override the meaning of numeric literals, the code would break.The
Lift ByteArray
instance inbase
1 is vulnerable to the same issue.https://gitlab.haskell.org/ghc/ghc/-/merge_requests/13270 fixes this but leads to a change in behaviour. If a user were to inspect the output of the
lift
call they would see a largely equivalent but distinct AST.It's highly unlikely that this would break anyone's code.
ByteArray
was only recently added tobase
, and most users oflift
do not inspect its output.Here is the relevant part of the diff for context:
Before this we got something like
addrToByteArray 10 ...
now we getaddrToByteArray 10# ...
(and the type of the non-exported functionaddrToByteArray
changed to accommodate this)Footnotes
The
Lift ByteArray
instance used to live intemplate-haskell
but had to be moved tobase
when all the wired-in definitions fromtemplate-haskell
were moved toghc-internal
. An orphan instance intemplate-haskell
would have no longer been guaranteed to be in scope for users and could have led to breakage. See: this comment ↩The text was updated successfully, but these errors were encountered: