Comments (11)
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.
I like the idea in principle but I also worry about allocations. Seems like it's worth prototyping.
from cats.
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.
@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.
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.
@ceedubs sounds like a plan
from cats.
Sounds good to me too.
from cats.
people are experimenting removing inheritance in scalaz 8:
https://github.com/scalaz/scalaz/blob/37d7c9c8746a1a47f5f05c465f29938654fda838/core/src/main/scala/Order.scala
from cats.
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.
@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.
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)
- `Apply` syntax is allocating HOT 2
- add `sizeIs` method like std-lib to `cats.Reducible` and/or NonEmpty collections HOT 1
- Maybe you are looking for `as`? :) HOT 2
- Fix documentation (or design) of Free Monad
- Type-classes for Prepend (Cons) and Append (Snoc) operations HOT 5
- Scala 3: No given instance of type cats.Applicative[[_] =>> Any] was found for parameter F of method apply in class PurePartiallyApplied
- Unusual EqLaws definition HOT 4
- Outdated Link in Docs - Seeking Guidance for Fix HOT 1
- algebra-core/src HOT 1
- Option size method implicitly selected from UnorderedFoldable HOT 2
- IndexedStateT has superfluous parts HOT 4
- .splitWhen
- Difference in the Applicative inferred for Seq[Seq[?]]#sequence between Scala 2 and 3
- Inconsistent behaviour when using Eval as Applicative
- `Tuple1SemigroupalOps` methods have different names from other `TupleNSemigroupalOps` classes HOT 3
- Instances for Currency HOT 7
- EitherT[Option, ?, ?]] can't be used as a bifunctor HOT 5
- trait EuclidianRing should not be a Ring HOT 4
- OutOfMemoryError when IO.uncancelable is used in recursive function HOT 1
- ambiguous implicit resolution of `Show.ContravariantShow[immutable.SortedMap[K, V]]` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cats.