Comments (6)
The format is not supposed to change. I can't see any changes at all in that code for at least the last 5 years.
You're absolutely supposed to be able to encode something with 0.5 and decode with 0.7, and the other way around. Anything else is a bug.
There was a blog post discussing the new addition to the API - but no format changes.
http://lennartkolmodin.blogspot.ru/2013/03/binary-07.html
Can you narrow it down a little bit?
from binary.
Can you narrow it down a little bit?
Ok, I’ll do that.
from binary.
Thanks.
The internals changed a lot between 0.5 and 0.7. Binary used to be a state monad and is not a CPS monad.
I think it's the getLazyByteString
that has become more picky. It seems like it previously didn't fail if there wasn't enough data available, and now it does.
https://github.com/kolmodin/binary/blob/0.5.1.1/src/Data/Binary/Get.hs
https://github.com/kolmodin/binary/blob/master/src/Data/Binary/Get.hs
It's used in src/Data/MyText.hs:34 in arbtt.
from binary.
Oh, well spotted. That must be it – hence the comment “safe approximation”.
Given that the docs of getLazyByteString
in binary-0.5.1.1 explicitly state that it does not fail if there are fewer bytes: Was the change in 0.7 deliberate?
I’ll see if replacing the code by code that takes remaining
into account solves the problem.
from binary.
Yes, that was it; now the test suite also works with binary-0.7. Thanks a lot for the help!
I’m closing this (but I opened #45 :-))
from binary.
The change was not deliberate, I did it by mistake. I like the new API better though.
This is the first time the issue has been brought up in 18 months, so I hope the impact of this "silent" change is not significant.
Sorry for the trouble and thanks for the report!
from binary.
Related Issues (20)
- Cut release for GHC 8.6.1 HOT 5
- Binary Instances for ByteArray, Array, etc. HOT 1
- I can't just get the answer and builder out of Put in a single call. HOT 2
- The `Binary Double` instance does not roundtrip. HOT 2
- Decoder prematurely reports "not enough bytes" HOT 3
- Cut release for GHC 8.8.1 HOT 5
- MonadFix instance required
- Cut release for GHC 8.10.1 HOT 5
- How does one specify a fixed length string?
- binary doesn't install with ghc 8.10.3 and containers 0.6.4.1 HOT 2
- How to change default byteorder? HOT 4
- Add Solo instance
- Export failG
- Generically instance HOT 1
- How to test?
- Ineffective INLINE pragmas on `many` method for `Alternative` `Get` instance.
- Inconsistent INLINE pragmas between word and int for builders.
- Performance of Generic-based instances. HOT 5
- Alternative instance for Get does not respect identity law in error situations
- Document safety expectations, or the lack thereof
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from binary.