-
Notifications
You must be signed in to change notification settings - Fork 158
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
automatic typeclass derivation #447
Conversation
Codecov Report
@@ Coverage Diff @@
## master #447 +/- ##
==========================================
+ Coverage 98.01% 98.03% +0.01%
==========================================
Files 57 57
Lines 655 660 +5
Branches 12 12
==========================================
+ Hits 642 647 +5
Misses 13 13
Continue to review full report at Codecov.
|
I think I need a few SAM type hints to keep the older scala versions happy. Or just not use SAM types. |
the 2.10 compile error is happening in a file I didn't touch... what's going on? |
The first error in the 2.10 build is
which is in a file you've added :-) |
@fthomas heh, yeah but one of the other files is also failing. I think 2.10's implicit resolution is just not good enough for this derivation. If you can think of a hack, that would be good, otherwise perhaps we should make this 2.11+ only? |
I tried shuffling the instances around but that didn't make a difference. I'm fine with making that 2.11+ only. |
@fthomas green lights! |
Looks great, many thanks @fommil! This is also a great example how to combine type classes via abstractions like |
@fthomas I'm trying to explore as much of the automatic derivation space as possible for the Typeclass Derivation chapter of my book. It was really good fun figuring this out and supporting refined types turned out to be much more elegant than I'd hoped. Create an iso to a readert and you get free decodings, nice! |
https://gitlab.com/fommil/scalaz-deriving/issues/56
we can also do covariant functors if the provide a
MonadError[?, String]
but I'm encountering some implicit problems... so raising this PR to discuss.