-
-
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
Symbols Glossary #1094
Symbols Glossary #1094
Conversation
Current coverage is 88.77%@@ master #1094 diff @@
==========================================
Files 228 228
Lines 3012 3012
Methods 2962 2962
Messages 0 0
Branches 47 47
==========================================
Hits 2674 2674
Misses 338 338
Partials 0 0
|
| Symbol | Name | Typeclass | Import | Source | | ||
| ------ | ---------------------- | ------------ | -------------------------- | ------------------------------------------------- | | ||
| `<*>` | apply | `Apply` | TBA | core/src/main/scala/cats/Apply.scala | | ||
| `|@|` | Cartesian builder | `Cartesian` | `cats.syntax.cartesian._` | core/src/main/scala/cats/Cartesian.scala | |
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.
Maybe the source location for this should be the generated source file in src_managed
?
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.
I also think we could leave out the source location and do pretty well. I'd rather have a column that relates the syntax to the type class, if possible. E.g.
| Symbol | Name | Typeclass | Definition | Import |
|---------|------------|----|------------------|----------------|
| x =!= y | not equals | Eq | Eq[A].neqv(x, y) | cats.syntax.eq |
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.
I also have mixed feelings about the imports. It is nice to let people know where things are, but I worry that this is encouraging people to use the piecemeal imports, which are often a source of frustration.
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.
@non I agree with getting rid of the imports and having an example usage.
I'm undecided about what to do with the source file. People often want to know where a symbol is defined, but because most of them use simulacrum or macro expansions, there isn't a straightforward location. @DavidGregory084 wouldn't references to src_managed
confuse people, as it isn't present on GitHub? Perhaps a link to the source file or syntax file would be better.
I'm leaning towards:
|Symbol | Name | Typeclass | Definition |
| ------- | -------- | ------------------------------------------------------ | ------------- |
| x =!= y | not equals | [cats.kernel.Eq](../../../../cats/kernel/Eq.scala) | Eq[A].neqv(x, y) |
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.
OK, I'm fine with links to the files. In the case of generated sources, maybe we should italicize the name instead of linkifying it, and then putting a note at the bottom that italicized names are from generated source?
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.
Would it make sense to link to the scaladoc instead of the source? That should have the generated methods, and it contains a link to the source in the non-generated case.
Right, I've added all the symbols I could find. Some points to note:
I'm also fairly new to functional programming in general, so I may have made some mistakes with the symbol names. |
Thanks for putting so much work into this @zainab-ali! I know symbols can often be a barrier for people, so I really like the idea of trying to clear them up. I think it'd be really neat if we could somehow inject this data into the symbols scaladoc page -- then we could be sure that it never goes out of date. I don't know if that's actually possible though. Are you aware of that page? It looks like there might be a couple of items on there that aren't in here. |
| `x === y` | equals | [`Eq[A]`](../../../../kernel/src/main/scala/cats/kernel/Eq.scala) | `eqv(x: A, y: A): Boolean` | | ||
| `x =!= y` | not equals | [`Eq[A]`](../../../../kernel/src/main/scala/cats/kernel/Eq.scala) | `neqv(x: A, y: A): Boolean` | | ||
| `fa >>= f` | flatMap | [`FlatMap[F[_]]`](../../../../core/src/main/scala/cats/syntax/flatMap.scala) | `flatMap(fa: F[A])(f: A => F[B]): F[B]`| | ||
| `fa >> fb` | followed by | [`FlatMap[F[_]]`](../../../../core/src/main/scala/cats/syntax/flatMap.scala) | `followedBy(fa: F[A])(fb: F[B]): F[B]` | |
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.
Should these two links go to the FlatMap
type class instead of syntax?
@ceedubs the symbols scaladoc page looks really useful! I hadn't heard of it before - perhaps it needs to be publicized a bit more? It would certainly be good to put this information there, if possible. EDIT: It seems to be inbaked in scaladoc itself. Thanks for showing me the existence of such a page! I'll research the possibilities of adding to it. |
I've hunted around, but I don't think it's possible to inject the data into the scaladoc page. Nevertheless, I've added a link to it. |
This is great! 👍 Thanks! |
Does anyone have thoughts on #1094 (comment) ? This has a pretty messy git history (33 commits) for a fairly isolated change. This isn't really the standard procedure, but it might be nice to squash commits here. |
I'd be fine with squashing the commits. Or not. Either way. |
Squashing the commits is proving difficult because of the merges in between. |
A first cut of the symbols glossary.
There are still many symbols and links to be added.