From cd6006feee11277af3122ea1129f2a93b594f97f Mon Sep 17 00:00:00 2001 From: yu-croco Date: Thu, 25 Jun 2020 10:46:45 +0900 Subject: [PATCH] make the meaning clearer --- docs/src/main/tut/datatypes/kleisli.md | 8 ++++---- docs/src/main/tut/typeclasses/typeclasses.md | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/src/main/tut/datatypes/kleisli.md b/docs/src/main/tut/datatypes/kleisli.md index 6ef00cb8e6..55d820a8b8 100644 --- a/docs/src/main/tut/datatypes/kleisli.md +++ b/docs/src/main/tut/datatypes/kleisli.md @@ -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. ``` @@ -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. @@ -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! diff --git a/docs/src/main/tut/typeclasses/typeclasses.md b/docs/src/main/tut/typeclasses/typeclasses.md index 072c602f44..efa4fa1a5a 100644 --- a/docs/src/main/tut/typeclasses/typeclasses.md +++ b/docs/src/main/tut/typeclasses/typeclasses.md @@ -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