-
-
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
Follow up to Seq Instances #3622
Comments
Update to the above: these are Scala 2.12 problems. On Scala 2.13, more of it works: scala> import cats._, cats.syntax.all._
import cats._
import cats.syntax.all._
scala> Seq(1, 2, 3) |+| Seq(3, 4, 5)
^
error: value |+| is not a member of Seq[Int]
did you mean ++: or :++?
scala> List(1, 2, 3) |+| List(3, 4, 5)
val res1: List[Int] = List(1, 2, 3, 3, 4, 5)
scala> def foo[F[_]: Monad, A](fa: F[A]) = ()
def foo[F[_], A](fa: F[A])(implicit evidence$1: cats.Monad[F]): Unit
scala> foo(Seq(1, 2, 3))
scala> foo(List(1, 2, 3))
scala> Seq(1, 2, 3) *> List(3, 4, 5)
val res5: Seq[Int] = List(3, 4, 5, 3, 4, 5, 3, 4, 5)
So the semigroup syntax still doesn't quite work, but the monad resolution does. The final expression though is something we should probably talk about, since I think a lot of us would have expected that to fail to compile. |
For 2.12 The way to make it work with out of the box source parody for 2.12 and 2.13 would be to implement these typeclasses for |
This is compelling, IMO. We shouldn't implement the instances for |
They don't appear to be working quite correctly? Follow up to #3620
I'm guessing we need to add some tests here and see if we can introspect what's going on, but I would have expected this to work.
The text was updated successfully, but these errors were encountered: