-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add map method to OneAnd. Fix for #885 #886
Conversation
OneAnd was missing an instance of map. This commit tries to solve this.
👍 - could you also replace the existing |
will do :) |
Current coverage is
|
…h the new map CoMonad required a explicit Functor[List], there may be a better alternative
Done! I'm not sure about the |
You probably added it because the type checker couldn't find a |
Import at trait level due to conflict with Semigroup definitions
@@ -131,9 +137,10 @@ private[data] sealed trait OneAndInstances extends OneAndLowPriority2 { | |||
} | |||
|
|||
trait OneAndLowPriority0 { | |||
import cats.std.list._ |
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.
Nitpicking: would prefer this to be moved to the top
One minor comment, but 👍 on Travis green |
Hm seems moving it to the top does funky things - anyone know why this is the case? Either way, 👍 from me |
Thanks @julien-truffaut for his help fixing this compilation error!
Fixed compilation issue when moving import to top, thanks to @julien-truffaut for his support (he was the one fixing it in fact, I'm just stealing the contribution :P) |
@@ -104,7 +111,7 @@ private[data] sealed trait OneAndInstances extends OneAndLowPriority2 { | |||
} | |||
|
|||
implicit def oneAndSemigroup[F[_]: MonadCombine, A]: Semigroup[OneAnd[F, A]] = | |||
oneAndSemigroupK.algebra | |||
oneAndSemigroupK(MonadCombine[F]).algebra |
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.
Sorry, this is nitpicky, but could you please change this to oneAndSemigroupK[F].algebra
? That will save a MonadCombine.apply
call.
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.
for some reason the compiler get confused with oneAndSemigroupK[F]
after adding import cats.std.list._
on the top of the file. It says that there is an ambiguity between MonadCombine[List]
and MonadCombine[F]
...
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.
sorry I misread your comment @ceedubs, you were right oneAndSemigroupK[F]
is enough to disambiguate.
👍 when the build is green |
Add map method to OneAnd. Fix for #885
OneAnd was missing an instance of map. This commit tries to solve this.