From 07fa10735f239e87d45f8ba3c77c15af34805ceb Mon Sep 17 00:00:00 2001 From: zainab-ali Date: Sat, 25 Mar 2017 19:58:18 +0000 Subject: [PATCH 1/5] Add symbols to FAQ --- docs/src/main/tut/faq.md | 32 ++++++++++++++++++++++++ docs/src/main/tut/typeclasses/symbols.md | 31 ----------------------- 2 files changed, 32 insertions(+), 31 deletions(-) delete mode 100644 docs/src/main/tut/typeclasses/symbols.md diff --git a/docs/src/main/tut/faq.md b/docs/src/main/tut/faq.md index 11bbb7dd43..d9577db4bb 100644 --- a/docs/src/main/tut/faq.md +++ b/docs/src/main/tut/faq.md @@ -19,6 +19,7 @@ position: 4 * [What do types like `?` and `λ` mean?](#kind-projector) * [What does `macro Ops` do? What is `cats.macros.Ops`?](#machinist) * [What is `tailRecM`?](#tailrecm) + * [What does this symbol mean?](#symbol) * [How can I help?](#contributing) ## What imports do I need? @@ -191,6 +192,37 @@ If you're having trouble figuring out how to implement `tailRecM` lawfully, you In some cases you may decide that providing a lawful `tailRecM` may be impractical or even impossible (if so we'd like to hear about it). For these cases we provide a way of testing all of the monad laws _except_ for the stack safety of `tailRecM`: just replace `MonadTests[F].monad[A, B, C]` in your tests with `MonadTests[F].stackUnsafeMonad[A, B, C]`. + +## What does this symbol mean? + +Below is a list of symbols used in cats. + +The `~>`, `⊥` and `⊤` symbols can be imported with `import cats._`. + +All other symbols can be imported with `import cats.implicits._` + +| Symbol | Name | Type Class | Signature | +| ---------- | ---------------------- | -------------------- |--------------------------------------- | +| `fa |@| fb`| Cartesian builder | `Cartesian[F[_]]` | `|@|(fa: F[A])(fb: F[B]): F[(A, B)]` | +| `fa *> fb` | right apply | `Cartesian[F[_]]` | `*>(fa: F[A])(fb: F[B]): F[A]` | +| `fa <* fb` | left apply | `Cartesian[F[_]]` | `<*(fa: F[A])(fb: F[B]): F[B]` | +| `x === y` | equals | `Eq[A]` | `eqv(x: A, y: A): Boolean` | +| `x =!= y` | not equals | `Eq[A]` | `neqv(x: A, y: A): Boolean` | +| `fa >>= f` | flatMap | `FlatMap[F[_]]` | `flatMap(fa: F[A])(f: A => F[B]): F[B]`| +| `fa >> fb` | followed by | `FlatMap[F[_]]` | `followedBy(fa: F[A])(fb: F[B]): F[B]` | +| `x |-| y` | remove | `Group[A]` | `remove(x: A, y: A): A` | +| `x > y` | greater than | `PartialOrder[A]` | `gt(x: A, y: A): Boolean` | +| `x >= y` | greater than or equal | `PartialOrder[A]` | `gteq(x: A, y: A): Boolean` | +| `x < y` | less than | `PartialOrder[A]` | `lt(x: A, y: A): Boolean` | +| `x <= y` | less than or equal | `PartialOrder[A]` | `lteq(x: A, y: A): Boolean` | +| `x |+| y` | Semigroup combine | `Semigroup[A]` | `combine(x: A, y: A): A` | +| `x <+> y` | SemigroupK combine | `SemigroupK[F[_]]` | `combineK(x: F[A], y: F[A]): F[A]` | +| `F ~> G` | natural transformation | `FunctionK[F[_], G[_]]` | `FunctionK` alias | +| `F :<: G` | inject | `Inject[F[_], G[_]]` | `Inject` alias | +| `F :≺: G` | inject | `Inject[F[_], G[_]]` | `Inject` alias | +| `⊥` | bottom | N/A | `Nothing` | +| `⊤` | top | N/A | `Any` | + ## How can I help? The cats community welcomes and encourages contributions, even if you are completely new to cats and functional programming. Here are a few ways to help out: diff --git a/docs/src/main/tut/typeclasses/symbols.md b/docs/src/main/tut/typeclasses/symbols.md deleted file mode 100644 index dc84bf5792..0000000000 --- a/docs/src/main/tut/typeclasses/symbols.md +++ /dev/null @@ -1,31 +0,0 @@ -#Symbols - -Below is a list of symbols used in cats. - -The `~>`, `⊥` and `⊤` symbols can be imported with `import cats._`. - -All other symbols can be imported with `import cats.implicits._` - -A scaladoc generated list is also available on the [Scaladoc symbols page](http://typelevel.org/cats/api/#index.index-_). - -| Symbol | Name | Type Class | Definition | -| ---------- | ---------------------- | ---------------------------------------------------------------------------------------- |--------------------------------------- | -| `fa |@| fb`| Cartesian builder | [`Cartesian[F[_]]`]({{ site.sources }}/core/src/main/scala/cats/Cartesian.scala) | `|@|(fa: F[A])(fb: F[B]): F[(A, B)]` | -| `fa *> fb` | right apply | [`Cartesian[F[_]]`]({{ site.sources }}/core/src/main/scala/cats/Cartesian.scala) | `*>(fa: F[A])(fb: F[B]): F[A]` | -| `fa <* fb` | left apply | [`Cartesian[F[_]]`]({{ site.sources }}/core/src/main/scala/cats/Cartesian.scala) | `<*(fa: F[A])(fb: F[B]): F[B]` | -| `x === y` | equals | [`Eq[A]`]({{ site.sources }}/kernel/src/main/scala/cats/kernel/Eq.scala) | `eqv(x: A, y: A): Boolean` | -| `x =!= y` | not equals | [`Eq[A]`]({{ site.sources }}/kernel/src/main/scala/cats/kernel/Eq.scala) | `neqv(x: A, y: A): Boolean` | -| `fa >>= f` | flatMap | [`FlatMap[F[_]]`]({{ site.sources }}/core/src/main/scala/cats/FlatMap.scala) | `flatMap(fa: F[A])(f: A => F[B]): F[B]`| -| `fa >> fb` | followed by | [`FlatMap[F[_]]`]({{ site.sources }}/core/src/main/scala/cats/FlatMap.scala) | `followedBy(fa: F[A])(fb: F[B]): F[B]` | -| `x |-| y` | remove | [`Group[A]`]({{ site.sources }}/kernel/src/main/scala/cats/kernel/Group.scala) | `remove(x: A, y: A): A` | -| `x > y` | greater than | [`PartialOrder[A]`]({{ site.sources }}/kernel/src/main/scala/cats/kernel/PartialOrder.scala)| `gt(x: A, y: A): Boolean` | -| `x >= y` | greater than or equal | [`PartialOrder[A]`]({{ site.sources }}/kernel/src/main/scala/cats/kernel/PartialOrder.scala)| `gteq(x: A, y: A): Boolean` | -| `x < y` | less than | [`PartialOrder[A]`]({{ site.sources }}/kernel/src/main/scala/cats/kernel/PartialOrder.scala)| `lt(x: A, y: A): Boolean` | -| `x <= y` | less than or equal | [`PartialOrder[A]`]({{ site.sources }}/kernel/src/main/scala/cats/kernel/PartialOrder.scala)| `lteq(x: A, y: A): Boolean` | -| `x |+| y` | Semigroup combine | [`Semigroup[A]`]({{ site.sources }}/kernel/src/main/scala/cats/kernel/Semigroup.scala) | `combine(x: A, y: A): A` | -| `x <+> y` | SemigroupK combine | [`SemigroupK[F[_]]`]({{ site.sources }}/core/src/main/scala/cats/SemigroupK.scala) | `combineK(x: F[A], y: F[A]): F[A]` | -| `F ~> G` | natural transformation | [`FunctionK[F[_], G[_]]`]({{ site.sources }}/core/src/main/scala/cats/arrow/FunctionK.scala)| `FunctionK` alias | -| `F :<: G` | inject | [`Inject[F[_], G[_]]`]({{ site.sources }}/free/src/main/scala/cats/free/package.scala) | `Inject` alias | -| `F :≺: G` | inject | [`Inject[F[_], G[_]]`]({{ site.sources }}/free/src/main/scala/cats/free/package.scala) | `Inject` alias | -| `⊥` | bottom | [N/A]({{ site.sources }}/core/src/main/scala/cats/package.scala) | `Nothing` | -| `⊤` | top | [N/A]({{ site.sources }}/core/src/main/scala/cats/package.scala) | `Any` | From 400555b942924f19f433522111af044d426ce8ae Mon Sep 17 00:00:00 2001 From: zainab-ali Date: Sun, 9 Apr 2017 18:43:17 +0100 Subject: [PATCH 2/5] Correct location of inject symbols --- docs/src/main/tut/faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/main/tut/faq.md b/docs/src/main/tut/faq.md index d9577db4bb..a12a5a786f 100644 --- a/docs/src/main/tut/faq.md +++ b/docs/src/main/tut/faq.md @@ -197,7 +197,7 @@ In some cases you may decide that providing a lawful `tailRecM` may be impractic Below is a list of symbols used in cats. -The `~>`, `⊥` and `⊤` symbols can be imported with `import cats._`. +The `~>`, `⊥`, `⊤`, `:<:` and `:≺:` symbols can be imported with `import cats._`. All other symbols can be imported with `import cats.implicits._` From d3b6dd859b8fd0db542013aab162511c4c43a183 Mon Sep 17 00:00:00 2001 From: zainab-ali Date: Wed, 3 May 2017 18:54:49 +0100 Subject: [PATCH 3/5] Add nicknames --- docs/src/main/tut/faq.md | 42 ++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/docs/src/main/tut/faq.md b/docs/src/main/tut/faq.md index 18264d1dfd..ceafea407a 100644 --- a/docs/src/main/tut/faq.md +++ b/docs/src/main/tut/faq.md @@ -212,27 +212,27 @@ The `~>`, `⊥`, `⊤`, `:<:` and `:≺:` symbols can be imported with `import c All other symbols can be imported with `import cats.implicits._` -| Symbol | Name | Type Class | Signature | -| ---------- | ---------------------- | -------------------- |--------------------------------------- | -| `fa |@| fb`| Cartesian builder | `Cartesian[F[_]]` | `|@|(fa: F[A])(fb: F[B]): F[(A, B)]` | -| `fa *> fb` | right apply | `Cartesian[F[_]]` | `*>(fa: F[A])(fb: F[B]): F[A]` | -| `fa <* fb` | left apply | `Cartesian[F[_]]` | `<*(fa: F[A])(fb: F[B]): F[B]` | -| `x === y` | equals | `Eq[A]` | `eqv(x: A, y: A): Boolean` | -| `x =!= y` | not equals | `Eq[A]` | `neqv(x: A, y: A): Boolean` | -| `fa >>= f` | flatMap | `FlatMap[F[_]]` | `flatMap(fa: F[A])(f: A => F[B]): F[B]`| -| `fa >> fb` | followed by | `FlatMap[F[_]]` | `followedBy(fa: F[A])(fb: F[B]): F[B]` | -| `x |-| y` | remove | `Group[A]` | `remove(x: A, y: A): A` | -| `x > y` | greater than | `PartialOrder[A]` | `gt(x: A, y: A): Boolean` | -| `x >= y` | greater than or equal | `PartialOrder[A]` | `gteq(x: A, y: A): Boolean` | -| `x < y` | less than | `PartialOrder[A]` | `lt(x: A, y: A): Boolean` | -| `x <= y` | less than or equal | `PartialOrder[A]` | `lteq(x: A, y: A): Boolean` | -| `x |+| y` | Semigroup combine | `Semigroup[A]` | `combine(x: A, y: A): A` | -| `x <+> y` | SemigroupK combine | `SemigroupK[F[_]]` | `combineK(x: F[A], y: F[A]): F[A]` | -| `F ~> G` | natural transformation | `FunctionK[F[_], G[_]]` | `FunctionK` alias | -| `F :<: G` | inject | `Inject[F[_], G[_]]` | `Inject` alias | -| `F :≺: G` | inject | `Inject[F[_], G[_]]` | `Inject` alias | -| `⊥` | bottom | N/A | `Nothing` | -| `⊤` | top | N/A | `Any` | +| Symbol | Name | Nickname | Type Class | Signature | +| ---------- | ---------------------- | ---------------- | ----------------------- | -------------------------------------- | +| `fa |@| fb`| Cartesian builder | Cinnabon, scream | `Cartesian[F[_]]` | `|@|(fa: F[A])(fb: F[B]): F[(A, B)]` | +| `fa *> fb` | right apply | | `Cartesian[F[_]]` | `*>(fa: F[A])(fb: F[B]): F[A]` | +| `fa <* fb` | left apply | | `Cartesian[F[_]]` | `<*(fa: F[A])(fb: F[B]): F[B]` | +| `x === y` | equals | | `Eq[A]` | `eqv(x: A, y: A): Boolean` | +| `x =!= y` | not equals | | `Eq[A]` | `neqv(x: A, y: A): Boolean` | +| `fa >>= f` | flatMap | | `FlatMap[F[_]]` | `flatMap(fa: F[A])(f: A => F[B]): F[B]`| +| `fa >> fb` | followed by | | `FlatMap[F[_]]` | `followedBy(fa: F[A])(fb: F[B]): F[B]` | +| `x |-| y` | remove | | `Group[A]` | `remove(x: A, y: A): A` | +| `x > y` | greater than | | `PartialOrder[A]` | `gt(x: A, y: A): Boolean` | +| `x >= y` | greater than or equal | | `PartialOrder[A]` | `gteq(x: A, y: A): Boolean` | +| `x < y` | less than | | `PartialOrder[A]` | `lt(x: A, y: A): Boolean` | +| `x <= y` | less than or equal | | `PartialOrder[A]` | `lteq(x: A, y: A): Boolean` | +| `x |+| y` | Semigroup combine | | `Semigroup[A]` | `combine(x: A, y: A): A` | +| `x <+> y` | SemigroupK combine | | `SemigroupK[F[_]]` | `combineK(x: F[A], y: F[A]): F[A]` | +| `F ~> G` | natural transformation | | `FunctionK[F[_], G[_]]` | `FunctionK` alias | +| `F :<: G` | injectK | | `InjectK[F[_], G[_]]` | `InjectK` alias | +| `F :≺: G` | injectK | | `InjectK[F[_], G[_]]` | `InjectK` alias | +| `⊥` | bottom | | N/A | `Nothing` | +| `⊤` | top | | N/A | `Any` | ## How can I help? From 84fa9c631c22623567994c717cc1c1bd41fff20b Mon Sep 17 00:00:00 2001 From: zainab-ali Date: Fri, 5 May 2017 12:06:09 +0100 Subject: [PATCH 4/5] Use html to render pipes within markdown --- docs/src/main/tut/faq.md | 42 ++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/docs/src/main/tut/faq.md b/docs/src/main/tut/faq.md index ceafea407a..ceb3546060 100644 --- a/docs/src/main/tut/faq.md +++ b/docs/src/main/tut/faq.md @@ -212,27 +212,27 @@ The `~>`, `⊥`, `⊤`, `:<:` and `:≺:` symbols can be imported with `import c All other symbols can be imported with `import cats.implicits._` -| Symbol | Name | Nickname | Type Class | Signature | -| ---------- | ---------------------- | ---------------- | ----------------------- | -------------------------------------- | -| `fa |@| fb`| Cartesian builder | Cinnabon, scream | `Cartesian[F[_]]` | `|@|(fa: F[A])(fb: F[B]): F[(A, B)]` | -| `fa *> fb` | right apply | | `Cartesian[F[_]]` | `*>(fa: F[A])(fb: F[B]): F[A]` | -| `fa <* fb` | left apply | | `Cartesian[F[_]]` | `<*(fa: F[A])(fb: F[B]): F[B]` | -| `x === y` | equals | | `Eq[A]` | `eqv(x: A, y: A): Boolean` | -| `x =!= y` | not equals | | `Eq[A]` | `neqv(x: A, y: A): Boolean` | -| `fa >>= f` | flatMap | | `FlatMap[F[_]]` | `flatMap(fa: F[A])(f: A => F[B]): F[B]`| -| `fa >> fb` | followed by | | `FlatMap[F[_]]` | `followedBy(fa: F[A])(fb: F[B]): F[B]` | -| `x |-| y` | remove | | `Group[A]` | `remove(x: A, y: A): A` | -| `x > y` | greater than | | `PartialOrder[A]` | `gt(x: A, y: A): Boolean` | -| `x >= y` | greater than or equal | | `PartialOrder[A]` | `gteq(x: A, y: A): Boolean` | -| `x < y` | less than | | `PartialOrder[A]` | `lt(x: A, y: A): Boolean` | -| `x <= y` | less than or equal | | `PartialOrder[A]` | `lteq(x: A, y: A): Boolean` | -| `x |+| y` | Semigroup combine | | `Semigroup[A]` | `combine(x: A, y: A): A` | -| `x <+> y` | SemigroupK combine | | `SemigroupK[F[_]]` | `combineK(x: F[A], y: F[A]): F[A]` | -| `F ~> G` | natural transformation | | `FunctionK[F[_], G[_]]` | `FunctionK` alias | -| `F :<: G` | injectK | | `InjectK[F[_], G[_]]` | `InjectK` alias | -| `F :≺: G` | injectK | | `InjectK[F[_], G[_]]` | `InjectK` alias | -| `⊥` | bottom | | N/A | `Nothing` | -| `⊤` | top | | N/A | `Any` | +| Symbol | Name | Nickname | Type Class | Signature | +| -------------------------------- | ---------------------- | ---------------- | ----------------------- | --------------------------------------------------------- | +| fa |@| fb | Cartesian builder | Cinnabon, scream | `Cartesian[F[_]]` | |@|(fa: F[A])(fb: F[B]): F[(A, B)] | +| `fa *> fb` | right apply | | `Cartesian[F[_]]` | `*>(fa: F[A])(fb: F[B]): F[A]` | +| `fa <* fb` | left apply | | `Cartesian[F[_]]` | `<*(fa: F[A])(fb: F[B]): F[B]` | +| `x === y` | equals | | `Eq[A]` | `eqv(x: A, y: A): Boolean` | +| `x =!= y` | not equals | | `Eq[A]` | `neqv(x: A, y: A): Boolean` | +| `fa >>= f` | flatMap | | `FlatMap[F[_]]` | `flatMap(fa: F[A])(f: A => F[B]): F[B]` | +| `fa >> fb` | followed by | | `FlatMap[F[_]]` | `followedBy(fa: F[A])(fb: F[B]): F[B]` | +| x |-| y | remove | | `Group[A]` | `remove(x: A, y: A): A` | +| `x > y` | greater than | | `PartialOrder[A]` | `gt(x: A, y: A): Boolean` | +| `x >= y` | greater than or equal | | `PartialOrder[A]` | `gteq(x: A, y: A): Boolean` | +| `x < y` | less than | | `PartialOrder[A]` | `lt(x: A, y: A): Boolean` | +| `x <= y` | less than or equal | | `PartialOrder[A]` | `lteq(x: A, y: A): Boolean` | +| x |+| y | Semigroup combine | | `Semigroup[A]` | `combine(x: A, y: A): A` | +| `x <+> y` | SemigroupK combine | | `SemigroupK[F[_]]` | `combineK(x: F[A], y: F[A]): F[A]` | +| `F ~> G` | natural transformation | | `FunctionK[F[_], G[_]]` | `FunctionK` alias | +| `F :<: G` | injectK | | `InjectK[F[_], G[_]]` | `InjectK` alias | +| `F :≺: G` | injectK | | `InjectK[F[_], G[_]]` | `InjectK` alias | +| `⊥` | bottom | | N/A | `Nothing` | +| `⊤` | top | | N/A | `Any` | ## How can I help? From 64b8393701ac2c872a5275d7b1ad624144461c9d Mon Sep 17 00:00:00 2001 From: zainab-ali Date: Tue, 9 May 2017 15:36:00 +0100 Subject: [PATCH 5/5] Add arrow symbols --- docs/src/main/tut/faq.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/src/main/tut/faq.md b/docs/src/main/tut/faq.md index ceb3546060..3aff209f51 100644 --- a/docs/src/main/tut/faq.md +++ b/docs/src/main/tut/faq.md @@ -221,6 +221,7 @@ All other symbols can be imported with `import cats.implicits._` | `x =!= y` | not equals | | `Eq[A]` | `neqv(x: A, y: A): Boolean` | | `fa >>= f` | flatMap | | `FlatMap[F[_]]` | `flatMap(fa: F[A])(f: A => F[B]): F[B]` | | `fa >> fb` | followed by | | `FlatMap[F[_]]` | `followedBy(fa: F[A])(fb: F[B]): F[B]` | +| `fa << fb` | for effect | | `FlatMap[F[_]]` | `forEffect(fa: F[A])(fb: F[B]): F[A]` | | x |-| y | remove | | `Group[A]` | `remove(x: A, y: A): A` | | `x > y` | greater than | | `PartialOrder[A]` | `gt(x: A, y: A): Boolean` | | `x >= y` | greater than or equal | | `PartialOrder[A]` | `gteq(x: A, y: A): Boolean` | @@ -228,6 +229,8 @@ All other symbols can be imported with `import cats.implicits._` | `x <= y` | less than or equal | | `PartialOrder[A]` | `lteq(x: A, y: A): Boolean` | | x |+| y | Semigroup combine | | `Semigroup[A]` | `combine(x: A, y: A): A` | | `x <+> y` | SemigroupK combine | | `SemigroupK[F[_]]` | `combineK(x: F[A], y: F[A]): F[A]` | +| `f <<< g` | Arrow compose | | `Compose[F[_, _]]` | `compose(f: F[B, C], g: F[A, B]): F[A, C]` | +| `f >>> g` | Arrow andThen | | `Compose[F[_, _]]` | `andThen(f: F[B, C], g: F[A, B]): F[A, C]` | | `F ~> G` | natural transformation | | `FunctionK[F[_], G[_]]` | `FunctionK` alias | | `F :<: G` | injectK | | `InjectK[F[_], G[_]]` | `InjectK` alias | | `F :≺: G` | injectK | | `InjectK[F[_], G[_]]` | `InjectK` alias |