-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scalaz 8 typeclass encoding. WIP. #52
Conversation
|
||
import cats.Applicative | ||
|
||
import acyclic.skipped |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this do? Do we need it? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Result of scalacOptions += "-P:acyclic:force"
Looks good so far, thank you Kamil! |
@LukaJCB please take a look into https://gitter.im/scalaz/scalaz, @edmundnoble shed some light. |
Thank you @kamilkloch! I had a look and now I'm thinking, do we actually need to use composition in the mtl-subset at all, since def foo[F[_], L](implicit ask: ApplicativeAsk[F, L], local: ApplicativeLocal[F, L]): F[L] = ??? I don't think this ever happens. Maybe we could get rid of the Does that make sense? |
@LukaJCB You are right. This would simplify the code at the cost of adding a highly unlikely potential implicit ambiguity. I was thinking of yet another thing: is there any way to actually inherit (not aggregate) from cats' typeclasses? I mean |
No, that would bring you the ambiguous implicit problem |
We could use the |
@SystemFw, what do you think, should we let |
We can do that, but it kinda constrains to not add any more leaves right? Unsure if it's a problem or not, practically |
ApplicativeAskClass[F[_], E] extends ApplicativeClass[F] (i.e., switch fully to the ineritance mode by adding some |
@SystemFw if we do add more leaves, we can just |
Codecov Report
@@ Coverage Diff @@
## master #52 +/- ##
==========================================
- Coverage 94.68% 94.22% -0.47%
==========================================
Files 71 71
Lines 734 727 -7
Branches 5 3 -2
==========================================
- Hits 695 685 -10
- Misses 39 42 +3
Continue to review full report at Codecov.
|
I'm not sure if this buys us a lot, unless we provide an implicit conversion from e.g. def foo[F[_]: Monad: ApplicativeAsk[?[_], Config]: F[A] = ??? |
And what that means is that the only place that really calls |
I agree. For consideration, last commit is with plain inheritance. |
Yes, I think it looks good this way 👍 |
If we are to proceed, shouldn't we do it in a new PR? |
Sure Sounds good to me :) |
I'll close this for now, we can always reopen if we reconsider :) |
First draft towards #26.
New encodings for: