cats icon indicating copy to clipboard operation
cats copied to clipboard

No scaladoc for `TupleNSemigroupalOps` classes (e.g. `mapN` method)?

Open m50d opened this issue 7 years ago • 6 comments

It looks like there's no scaladoc for the various Tuple*SemigroupalOps classes - e.g. on https://typelevel.github.io/cats/api/cats/syntax/package$$apply$.html there is a link to ApplyOps documentation but not to Tuple2SemigroupalOps. And searching for mapN returns nothing. I assume that's because these classes are generated from Boilerplate.scala rather than existing directly in the codebase.

m50d avatar Jul 17 '18 15:07 m50d

I'd say this is due to these classes being private[syntax].

nigredo-tori avatar Nov 20 '20 07:11 nigredo-tori

Well, I'm not too concerned about the details of how it's implemented, but mapN is an important API that ought to have scaladoc available somehow.

m50d avatar Nov 20 '20 08:11 m50d

I removed the private[syntax] and then mapN and friends appear in the scaladocs. Do you think this is the correct solution, and I should push a PR?

diff --git a/project/Boilerplate.scala b/project/Boilerplate.scala
index 338789542..20c3d9c8e 100644
--- a/project/Boilerplate.scala
+++ b/project/Boilerplate.scala
@@ -490,7 +490,7 @@ object Boilerplate {
         -  implicit def catsSyntaxTuple${arity}Semigroupal[F[_], ${`A..N`}]($tupleTpe): Tuple${arity}SemigroupalOps[F, ${`A..N`}] = new Tuple${arity}SemigroupalOps(t$arity)
       |}
       |
-        -private[syntax] final class Tuple${arity}SemigroupalOps[F[_], ${`A..N`}](private val $tupleTpe) extends Serializable {
+        -final class Tuple${arity}SemigroupalOps[F[_], ${`A..N`}](private val $tupleTpe) extends Serializable {
         -  $map
         -  $contramap
         -  $imap

index_html_search_mapn

arosien avatar Nov 20 '20 17:11 arosien

I'm not sure why the implicit classes are marked private in the first place.

arosien avatar Nov 20 '20 17:11 arosien

Yeah I think that PR would be appreciated, I wonder why they were marked private too

LukaJCB avatar Nov 23 '20 17:11 LukaJCB

Yeah I think that PR would be appreciated, I wonder why they were marked private too

Probably to prevent anyone from using them explicitly 🤷

joroKr21 avatar Nov 23 '20 17:11 joroKr21