Closed cocreature closed 4 years ago
LGTM, thanks!!
Note: I have some unpushed changes, fixing the other issues, that I will revisit later this evening
@cocreature I've fixed building of the tests and added explicit unit tests for the serialization of Integer
: https://github.com/fpco/store/commit/560819846c6920f8e8c47095daa51ce25349bb2b
I'd really appreciate it if you ran the tests with integer-simple. For some reason I can't seem to build the tests with the flag on, it seems to trigger a variety of different build tool issues:
With stack-1.9.3, planning fails: https://gist.github.com/mgsloan/ec6d73fa2e28a8488b638ab9225d454c
With stack-2.2.0, ghc complains about a mismatched hi file, where it seems to expect the version to be included in the hi file: https://gist.github.com/mgsloan/c1ab1688a48b3c9c288153610dc41397
With cabal new-build, dependency resolution fails: https://gist.github.com/mgsloan/3ddb58af3f4a5405d2ce1e926436a1ff
¯\(ツ)/¯
Definitely have the flag and extra dep in the stack.yaml https://gist.github.com/mgsloan/d92ed7f28d19ebeb469fdb398a59efc0
@mgsloan Note that you need a different GHC bindist for integer-simple, I got mine via nix. I’ve run the tests (after constraining primititive
to 0.6.4.0 since the newly added instances break the TH code in the tests). Everything works except for the tests that you have added after my PR. That is expected, I didn’t attempt to match the serialization format used for integer-gmp
and instead opted for one that naturally fits with integer-simple
.
In principle it would be possible to match the serialization format of integer-gmp
, however if that is a goal I think it would be preferable to change the seriailzation format to something that is less dependent on integer-gmp
internals. Currently the serialization format is very specific to how integer-gmp
works so given that integer-simple
works differently (it doesn’t have the small-size optimization, it has a separate 0 value, the digits are an array of words rather than an array of bytes, …) targeting the integer-gmp
format is quite tricky and probably a fair bit slower than what we have now.
@cocreature Oh I see. I thought otherwise because this comment got copied when you wrote the integer-simple code:
 -- May as well put in the extra effort to use the same encoding as
 -- used for the newer integer-gmp.
I've pushed changes documenting this mismatch and removing the test
This change is included in 0.6.1, thanks!
fixes #135