-
Notifications
You must be signed in to change notification settings - Fork 141
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
TH Lift #392
TH Lift #392
Conversation
I think there is some problem with
yet the code , testCase "binary" $ do
let bs :: LBS.ByteString
bs = "\0\1\2\3\0\1\2\3"
-- print $ LBS.unpack bs
-- print $ LBS.unpack $(TH.lift $ LBS.pack [0,1,2,3,0,1,2,3])
bs @=? $(TH.lift $ LBS.pack [0,1,2,3,0,1,2,3]) is very trivial. I'm not sure whom to blame, |
I see
firign, but it IMHO should NOT fire on (Modified-UTF8) encoded "\0\1\2\3\0\1\2\3". @bgamari Can you check this. The test suite passes on GHC-8.10.4 and older, so I think its GHC issue. EDIT: sorry, it was for "foobar", so it's not the culprit. |
I opened #393 for literal issue, I can reproduce it with |
74d764b
to
9dd65a0
Compare
I don't know what's wrong with windows job, but it seem to cancel everything else? |
CI green. |
Do you want to do this in this PR? |
f049b72
to
38109e3
Compare
@sjakobi thanks for the reminder. |
`TH.appE` TH.litE (TH.BytesPrimL $ TH.Bytes ptr 0 (fromIntegral len)) | ||
#else | ||
lift bs@(BS _ len) = [| unsafePackLenLiteral |] | ||
`TH.appE` TH.litE (TH.integerL (fromIntegral len)) |
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.
Could we possibly have less duplication? It seems that only the last line is conditional on template-haskell
version. Same for SBS
.
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.
it's not the same,
lift (BS ptr len) = ...
vs
lift bs@(BS _ len) = ...
Disable unused variable warning and I will simpify.
@@ -165,6 +165,15 @@ test-suite test-builder | |||
ghc-options: -Wall -fwarn-tabs -threaded -rtsopts | |||
default-language: Haskell2010 | |||
|
|||
test-suite bytestring-th |
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.
Please put this into one of existing test suites. Linking an additional executable is expensive on Windows.
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.
In which of three it belongs? lazy-hclose and test-builder seems to be testing specific features, and prop-compiled is for properties. It looks like fourth test-suite for an isolated feature is following the example.
... which hopefully works better
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.
Looks good, I'll merge all test suites into one executable later.
When the next release will be made? Will |
Feature freeze for GHC 9.2 was half a year ago and RC is out, so I expect it to stick with My plan is to release |
|
In particular: https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/libraries/version-history
|
It's not like I'm against making new developments of |
Can |
WIP, have to add SBS instance still.
Builds on top of #390, because there is better "primtiive" to pack
Addr#
, we can do better then is currently done inhttps://hackage.haskell.org/package/th-lift-instances-0.1.18/docs/src/Instances.TH.Lift.html#line-281