GithubHelp home page GithubHelp logo

Decoders are ugly about rho HOT 9 CLOSED

http4s avatar http4s commented on July 22, 2024
Decoders are ugly

from rho.

Comments (9)

arouel avatar arouel commented on July 22, 2024

+1

from rho.

bryce-anderson avatar bryce-anderson commented on July 22, 2024

Do we know of a symbol that means 'decoding'? I would like to do something as follows

GET / "foo" |#>[JValue] { result: JValue => ??? }

but this restricts us to having a type per decoder unless we want to place it at the end ala.

GET / "foo" |#> { result: JValue => ??? }(dec: Decoder[JValue]) // type annotation for clarity

Of course this could be solved with an alias,

GET / "foo" |##>(dec: Decoder[JValue]) { result: JValue => ??? }

This formulation will remove the ability to add more header requirements or even another codec after adding a codec. The second one isn't really a deal breaker as you will likely want to pack them together beforehand anyway.
I'm not sure of this yet, but it could allow for the removal of the CodecRouter type.

from rho.

arouel avatar arouel commented on July 22, 2024

I've no better symbol yet for decoding but I like your choice. I like your second example and the alias for it, that's what I would use.

from rho.

bryce-anderson avatar bryce-anderson commented on July 22, 2024

Commit a45f65e did away with our own decoder type in favor of the http4s EntityDecoders.

from rho.

arouel avatar arouel commented on July 22, 2024

Nice that we use the http4s EntityDecoders now.

from rho.

bryce-anderson avatar bryce-anderson commented on July 22, 2024

Yes, and hopefully we can coalesce more of these niceties into shared code. That is part of what rho is for: find the squeaks in http4s. I would like to find a way to share the ResponseGenerators that the http4s.Status currently uses, but I would really like to get the response type information.

from rho.

arouel avatar arouel commented on July 22, 2024

Awesome, currently I'm really busy and could not help much but the direction sounds really good. Thank you

from rho.

bryce-anderson avatar bryce-anderson commented on July 22, 2024

Glad you like the direction. Hope your load lightens soon: its nice when
you're around pushing those high quality commits and calling me out on my
poor test/documentation discipline. Glad you're on the team.

On Tue, Aug 5, 2014 at 3:57 PM, André Rouél [email protected]
wrote:

Awesome, currently I'm really busy and could not help much but the
direction sounds really good. Thank you


Reply to this email directly or view it on GitHub
#15 (comment).

from rho.

bryce-anderson avatar bryce-anderson commented on July 22, 2024

I think this should have been closed.

from rho.

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.