GithubHelp home page GithubHelp logo

Comments (6)

kolmodin avatar kolmodin commented on May 20, 2024

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.

nomeata avatar nomeata commented on May 20, 2024

Can you narrow it down a little bit?

Ok, I’ll do that.

from binary.

kolmodin avatar kolmodin commented on May 20, 2024

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.

nomeata avatar nomeata commented on May 20, 2024

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.

nomeata avatar nomeata commented on May 20, 2024

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.

kolmodin avatar kolmodin commented on May 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.