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

Doc fixes #3028

Merged
merged 5 commits into from
Sep 4, 2019
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion docs/src/main/tut/datatypes/freemonad.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ case class AddCat(a: String) extends DataOp[Unit]
case class GetAllCats() extends DataOp[List[String]]
```

Once the ADTs are defined we can formally state that a `Free` program is the EitherK of it's Algebras.
Once the ADTs are defined we can formally state that a `Free` program is the EitherK of its Algebras.

```tut:silent
type CatsApp[A] = EitherK[DataOp, Interact, A]
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/tut/datatypes/ior.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ val left = "Error".leftIor

When we look at the `Monad` or `Applicative` instances of `Ior`, we can see that they actually requires a `Semigroup` instance on the left side.
This is because `Ior` will actually accumulate failures on the left side, very similar to how the [`Validated`](validated.html) data type does.
This means we can accumulate data on the left side while also being able to short-circuit upon the first right-side-only value.
This means we can accumulate data on the left side while also being able to short-circuit upon the first left-side-only value.
For example, sometimes, we might want to accumulate warnings together with a valid result and only halt the computation on a "hard error"
Here's an example of how we might be able to do that:

Expand Down
4 changes: 2 additions & 2 deletions docs/src/main/tut/typeclasses/eq.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import cats.implicits._

Implementing `Eq` instances yourself for every data type might seem like huge drawback compared to only slight gains of typesafety.
Fortunately for us, we have two great options. One option is to use inbuilt helper functions.
Another option is to use a small library called [kittens](https://github.com/milessabin/kittens), which can derive a lot of type class instances for our data types including `Eq`.
Another option is to use a small library called [kittens](https://github.com/typelevel/kittens), which can derive a lot of type class instances for our data types including `Eq`.

The first option using `Eq.fromUniversalEquals` only defers to `==` and works like this:

Expand All @@ -68,4 +68,4 @@ Foo(10, "") === Foo(10, "")
```


For an example using Kittens check out the [kittens repo](https://github.com/milessabin/kittens).
For an example using Kittens check out the [kittens repo](https://github.com/typelevel/kittens).
2 changes: 1 addition & 1 deletion docs/src/main/tut/typeclasses/monad.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ In addition to requiring `flatMap` and `pure`, Cats has chosen to require
[Stack Safety for Free](http://functorial.com/stack-safety-for-free/index.pdf) by
Phil Freeman. Because monadic recursion is so common in functional programming but
is not stack safe on the JVM, Cats has chosen to require this method of all monad implementations
as opposed to just a subset. All functions requiring monadic recursion in Cats is done via
as opposed to just a subset. All functions requiring monadic recursion in Cats do so via
`tailRecM`.

An example `Monad` implementation for `Option` is shown below. Note the tail recursive
Expand Down
6 changes: 3 additions & 3 deletions docs/src/main/tut/typeclasses/monoidk.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ scaladoc: "#cats.MonoidK"
---
# MonoidK

`MonoidK` is a universal monoid which operates on kinds.
`MonoidK` is a universal monoid which operates on type constructors of one argument.

This type class is useful when its type parameter `F[_]` has a
structure that can be combined for any particular type, and which
also has an "empty" representation. Thus, `MonoidK` is like a `Monoid`
for kinds (i.e. parametrized types).
for type constructors (i.e. parametrized types).

A `MonoidK[F]` can produce a `Monoid[F[A]]` for any type `A`.

Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/tut/typeclasses/parallel.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def parsePerson(ageString: String, nameString: String) =
```

We had to convert to and from `Validated` manually.
While this is still manageble, it get's worse the more `Eithers` we want to combine in parallel.
While this is still manageble, it gets worse the more `Eithers` we want to combine in parallel.

To mitigate this pain, Cats introduces a type class `Parallel` that abstracts over `Monads` which also support parallel composition.
It is simply defined in terms of conversion functions between the two data types:
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/tut/typeclasses/show.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ implicit val showDep: Show[Department] = Show.fromToString


This still may not seem useful to you, because case classes already automatically implement `toString`, while `show` would have to be implemented manually for each case class.
Thankfully with the help of a small library called [kittens](https://github.com/milessabin/kittens) a lot of type class instances including `Show` can be derived automatically!
Thankfully with the help of a small library called [kittens](https://github.com/typelevel/kittens) a lot of type class instances including `Show` can be derived automatically!

Cats also offers `Show` syntax to make working with it easier.
This includes the `show` method which can be called on anything with a `Show` instance in scope:
Expand Down