Skip to content

Commit

Permalink
make the meaning clearer (#3497)
Browse files Browse the repository at this point in the history
  • Loading branch information
yu-croco authored Jun 25, 2020
1 parent 1411dcf commit 81a2efe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions docs/src/main/tut/datatypes/kleisli.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ final case class Kleisli[F[_], A, B](run: A => F[B]) {
}
```

Below are some more methods on `Kleisli` that can be used so long as the constraint on `F[_]`
Below are some more methods on `Kleisli` that can be used as long as the constraint on `F[_]`
is satisfied.

```
Expand All @@ -119,8 +119,8 @@ traverse | Applicative
### Type class instances
The type class instances for `Kleisli`, like that for functions, often fix the input type (and the `F[_]`) and leave
the output type free. What type class instances it has tends to depend on what instances the `F[_]` has. For
instance, `Kleisli[F, A, B]` has a `Functor` instance so long as the chosen `F[_]` does. It has a `Monad`
instance so long as the chosen `F[_]` does. The instances in Cats are laid out in a way such that implicit
instance, `Kleisli[F, A, B]` has a `Functor` instance as long as the chosen `F[_]` does. It has a `Monad`
instance as long as the chosen `F[_]` does. The instances in Cats are laid out in a way such that implicit
resolution will pick up the most specific instance it can (depending on the `F[_]`).

An example of a `Monad` instance for `Kleisli` is shown below.
Expand Down Expand Up @@ -259,7 +259,7 @@ final case class Kleisli[F[_], A, B](run: A => F[B]) {

What `local` allows us to do is essentially "expand" our input type to a more "general" one. In our case, we
can take a `Kleisli` that expects a `DbConfig` or `ServiceConfig` and turn it into one that expects an `AppConfig`,
so long as we tell it how to go from an `AppConfig` to the other configs.
as long as we tell it how to go from an `AppConfig` to the other configs.

Now we can create our application config validator!

Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/tut/typeclasses/typeclasses.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ implicit val intAdditionMonoid: Monoid[Int] = new Monoid[Int] {
def combineAll[A](list: List[A])(implicit A: Monoid[A]): A = list.foldRight(A.empty)(A.combine)
```

Now we can also `combineAll` a list of `Pair`s so long as `Pair`'s type parameters themselves have `Monoid`
Now we can also `combineAll` a list of `Pair`s as long as `Pair`'s type parameters themselves have `Monoid`
instances.

```tut:book:silent
Expand Down

0 comments on commit 81a2efe

Please sign in to comment.