Code Monkey home page Code Monkey logo

Comments (11)

ceedubs avatar ceedubs commented on May 16, 2024

I seem to recall that the main reason scalaz didn't take this approach was because of the extra overhead of all of the implicit chaining (the extra function calls and instance allocations). I'm not sure how much of a problem this is in practice. Also for what it's worth, I think that I heard @tpolecat say that scalaz has considered taking this approach in scalaz 8.0.

from cats.

tpolecat avatar tpolecat commented on May 16, 2024

I like the idea in principle but I also worry about allocations. Seems like it's worth prototyping.

from cats.

non avatar non commented on May 16, 2024

I'm pretty skeptical (as I said on #71). I think the nested field lookups for every single method call will be really bad for performance. I think this strategy is a non-starter for Spire and Algebra.

If we did some testing and found that for Cats it would be OK, then we could move to it, but would have to drop interop with Algebra and Spire. I'm pretty reluctant to do this but willing to talk about it.

from cats.

julien-truffaut avatar julien-truffaut commented on May 16, 2024

@non I understand and share your concern regarding the performance of using evidence. I will try to benchmark the two approach at some point.

Should I close this ticket until we have evidence that a non inheritance base approach provide good performance?

from cats.

ceedubs avatar ceedubs commented on May 16, 2024

I just added the "on hold" label. I don't think we need to completely close the issue if it's still under consideration. If it sits here and rots for months then we can close it out.

from cats.

julien-truffaut avatar julien-truffaut commented on May 16, 2024

@ceedubs sounds like a plan

from cats.

non avatar non commented on May 16, 2024

Sounds good to me too.

from cats.

julien-truffaut avatar julien-truffaut commented on May 16, 2024

people are experimenting removing inheritance in scalaz 8:
https://github.com/scalaz/scalaz/blob/37d7c9c8746a1a47f5f05c465f29938654fda838/core/src/main/scala/Order.scala

from cats.

retronym avatar retronym commented on May 16, 2024

I tried both approaches in the lead up to Scalaz 7, but found it the inheritance free version was unworkable.

def foo[F: Functor]
def bar[F: Monad] = foo // will not typecheck

Adding an "upcasting" implicit from Monad[F] => Functor[F] seems to work until you extend the hierarchy beyond a depth of 2, or, worse, introduce diamonds.

from cats.

non avatar non commented on May 16, 2024

@julien-truffaut there hasn't been any discussion on this issue. Do you want to keep it open? Are there concrete proposals to move forward?

from cats.

julien-truffaut avatar julien-truffaut commented on May 16, 2024

No we didn't have any discussion regarding this issue recently. So it is better to close it for the moment.

I think scalaz 8 is looking toward this approach, we can always monitor how does it go.

from cats.

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.