GithubHelp home page GithubHelp logo

Comments (5)

arouel avatar arouel commented on July 22, 2024

Do we have an example what flexibility we loose in the route definition?

from rho.

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

We would lose the ability to do

route |>> { () => "foo" }

and would instead require

route |>> { () => OK("foo") }

but wouldn't lose the ability to send any particular types. It would end up
limiting the reuse of functions as I can see things of the form being
hindered:

def foo(): String =??
route |>> foo

from rho.

arouel avatar arouel commented on July 22, 2024

Okay, understand! I think this is a really good idea and leads to a more explicit response definition that is really valuable.

from rho.

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

Alright, when I get some time I'll branch and see what I can do. If you want to get at it, just post a message here so I don't duplicate your effort.

from rho.

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

I've made a branch to start feeling it out. Some notes.

  • Pretty much non of the http4s core EntityResponseGenerator stuff can be reused and may be confusing
  • Reverse routing is less useful, but not dramatically so
  • We can eliminate the ObjToResponse stuff and the burden gets moved to the HListToFunc

I don't like how much we lose, but I think its a requirement to be able to return different statuses so I think this might be the way to go. I'd love to hear other opinions.

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.