Giter Site home page Giter Site logo

Comments (7)

adamgundry avatar adamgundry commented on July 17, 2024

Just a quick observation from the trenches: it would be useful if the API exposed the "with" variants of Serialise instances, e.g.

encodeListWith :: (a -> Encoding) -> [a] -> Encoding

instead of just

defaultEncodeList :: Serialise a => [a] -> Encoding

from cborg.

dcoutts avatar dcoutts commented on July 17, 2024

Probably the .Class module should re-export all the useful bits of .Encoding and .Decoding that are useful for writing class instances. It should also export the class QC properties (which themselves do not depend on QC at all).

from cborg.

dcoutts avatar dcoutts commented on July 17, 2024

@adamgundry for what use case? For writing instances for sequence-like types?

from cborg.

adamgundry avatar adamgundry commented on July 17, 2024

Actually, decoding is probably a better example than encoding. I have a decoder that can't (conveniently) be a class instance, because it depends on values being passed in, which describe the generic schema of the CBOR data. But I still want to use the standard encoding/decoding functions for lists. Here's the relevant code in api-tools.

from cborg.

dcoutts avatar dcoutts commented on July 17, 2024

Should also decide on names, encode/decode or serialise/deserialise? The binary package uses get/put and Binary. The cereal package uses get/put and Cereal. The store package uses peek/poke and Store.

from cborg.

bgamari avatar bgamari commented on July 17, 2024

Frankly I think the status quo is fine.

from cborg.

bgamari avatar bgamari commented on July 17, 2024

I think we can safely close this now since the thing is released.

from cborg.

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.