Skip to content
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

Closed
wants to merge 21 commits into from
Closed
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions docs/src/main/tut/symbols.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
| 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 |
Copy link
Member

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?

Copy link
Contributor

@non non Jun 7, 2016

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 |

Copy link
Contributor

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.

Copy link
Contributor Author

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) |

Copy link
Contributor

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?

Copy link
Contributor

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 apply | `Cartesian` | `cats.syntax.cartesian._` | core/src/main/scala/cats/Cartesian.scala |
| `<*` | left apply | `Cartesian` | `cats.syntax.cartesian._` | core/src/main/scala/cats/Cartesian.scala |
| `===` | equals | `Eq` | `cats.syntax.eq._` | kernel/src/main/scala/cats/kernel/Eq.scala |
| `=!=` | not equals | `Eq` | `cats.syntax.eq._` | kernel/src/main/scala/cats/kernel/Eq.scala |
| `>>=` | flatMap | `FlatMap` | `cats.syntax.flatMap._` | core/src/main/scala/cats/FlatMap.scala |
| `|-|` | remove | `Group` | `cats.syntax.group._` | kernel/src/main/scala/cats/kernel/Group.scala |
| `>` | greater than | `PartialOrder` | `cats.syntax.partialOrder._` | kernel/src/main/scala/cats/kernel/PartialOrder.scala|
| `>=` | greater than or equal | `PartialOrder` | `cats.syntax.partialOrder._` | kernel/src/main/scala/cats/kernel/PartialOrder.scala|
| `<` | less than | `PartialOrder` | `cats.syntax.partialOrder._` | kernel/src/main/scala/cats/kernel/PartialOrder.scala|
| `<=` | less than or equal | `PartialOrder` | `cats.syntax.partialOrder._` | kernel/src/main/scala/cats/kernel/PartialOrder.scala|
| `|+|` | plus | `Semigroup` | `cats.syntax.semigroup._` | kernel/src/main/scala/cats/kernel/Semigroup.scala |
| `<+>` | combine | `SemigroupK` | `cats.syntax.semigroupk._` | core/src/main/scala/cats/SemigroupK.scala |
| `~>` | natural transformation | `FunctionK` | `cats._` | core/src/main/scala/cats/arrow/FunctionK.scala |
| `⊥` | bottom | N/A | `cats._` | core/src/main/scala/cats/package.scala |
| `⊤` | top | N/A | `cats._` | core/src/main/scala/cats/package.scala |