Open chuwy opened 8 years ago
@chuwy would you consider this to be solved by #1565? The instances aren't listed on the type class page itself, but personally I think that the high-level overview provided by the table might be even more helpful, since it allows you to compare which instances are available for which types.
Hi @ceedubs,
Yes, that PR covers most I wanted to see.
However, there's one problem - namely it doesn't cover too many type classes (Traverse, Semigroup, Arrow etc) and data types (Future, Kleisli etc). I can take over that table and add everything it misses, but I afraid that would make it bloated and unusable.
So if we think that listing instances (more Hackage-way) on type class page is bad idea and cannot come up with anything better (I cannot) then I'm happy to close this.
@chuwy ah, that's a good point. I like the idea of listing instances on the type class page; I'm just concerned about the maintenance. We don't have an automated way to keep it up-to-date, and I suspect that it will be prone to falling out-of-date. It could be useful even if it isn't perfect though.
@ceedubs getting out-of-date was my concern as well, but I guess that will be not such a problem when cats reach 1.0.
:+1: to listing instances on the type class page. Sounds useful.
I think it should be possible to find all the instances we define using Scalameta...
Possibly even something like A, Monad[F] => Monad[Kleisli[F, A, ?]]
.
Do you think it's worth taking a look? I'd gladly try doing a prototype myself, if it sounds like a good idea.
@kubukoz sounds a good idea to me.
I think it would be very nice to have list of instances for which type class is implemented on type class documentation page. For example, on Functor page we can list:
Option
List
Stream
Future
Xor
I like that we have this on Hackage, but for cats this probably should be done manually, (although I think I heard something about support of type classes in scaladoc) to concisely highlight implementation details and just because I doubt this can be autogenerated.
I think this can highly improve approachability in following ways:
Option
andList
forFunctor
are obvious and well-known, some are not (functions). At least they weren't for mewith Monad[Option]
inoptionInstances