-
-
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
Tuple1SemigroupalOps
methods have different names from other TupleNSemigroupalOps
classes
#4555
Comments
Although I don't know for sure the reasoning behind such naming conventions, my guess is that despite In other words, we can assume that |
|
I've just realized there's even a broader issue with import cats.syntax.functor._
scala> val t1 = Tuple1(List("A", "B"))
val t1: (List[String],) = (List(A, B),)
scala> t1.map(s => s"$s!")
val res0: (String,) = (List(A, B)!,) However, if I use another syntax import: scala> import cats.syntax.apply._
scala> val t1 = Tuple1(List("A", "B"))
val t1: (List[String],) = (List(A, B),)
scala> t1.map(s => s"$s!")
val res0: List[String] = List(A!, B!) I.e. the same I think it is somewhat confusing. |
I don't know whether this is a deliberate design decision, but it seems wrong to me: the
TupleNSemigroupalOps
classes offer a consistent family of methods likemapN
andtraverseN
, but forTuple1SemigroupalOps
these get generated asmap
andtraverse
instead. I'd like to be able to work consistently with tuples of any size, including 1, so I think it would make more sense ifTuple1SemigroupalOps
(and friends) generated the samemapN
/traverseN
/etc. methods that are present on all the otherTupleNSemigroupalOps
classes.The text was updated successfully, but these errors were encountered: