From cdd087dd631af8c9c5dae5ea27e74109ea7fbfda Mon Sep 17 00:00:00 2001 From: Mathieu Pichette Date: Sun, 14 Nov 2021 15:42:24 -0800 Subject: [PATCH] fix typos and replace leftover Stream mentions to LazyList --- src/pages/applicatives/applicative.md | 2 +- src/pages/applicatives/parallel.md | 6 +++--- src/pages/case-studies/crdt/g-counter.md | 2 +- src/pages/foldable-traverse/foldable-cats.md | 2 +- src/pages/foldable-traverse/foldable.md | 2 +- src/pages/foldable-traverse/traverse-cats.md | 2 +- src/pages/foldable-traverse/traverse.md | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/pages/applicatives/applicative.md b/src/pages/applicatives/applicative.md index 3976df38..648d6938 100644 --- a/src/pages/applicatives/applicative.md +++ b/src/pages/applicatives/applicative.md @@ -42,7 +42,7 @@ The `product` method from `Semigroupal` is defined in terms of `ap` and `map`. Don't worry too much about the implementation of `product`---it's -difficult to read and the details aren't particuarly important. +difficult to read and the details aren't particularly important. The main point is that there is a tight relationship between `product`, `ap`, and `map` that allows any one of them to be defined diff --git a/src/pages/applicatives/parallel.md b/src/pages/applicatives/parallel.md index 8089891f..17e7d59f 100644 --- a/src/pages/applicatives/parallel.md +++ b/src/pages/applicatives/parallel.md @@ -1,7 +1,7 @@ ## Parallel In the previous section we saw that -when call `product` on a type that +when we call `product` on a type that has a `Monad` instance we get sequential semantics. This makes sense from the point-of-view @@ -132,7 +132,7 @@ As the type parameter `A` is generic a `FunctionK` cannot inspect any values contained with the type constructor `M`. The conversion must be performed purely in terms of the structure of the type constructors `M` and `F`. -We can in `optionToList` above +We can see in `optionToList` above this is indeed the case. So in summary, @@ -155,7 +155,7 @@ Does `List` have a `Parallel` instance? If so, what does the `Parallel` instance
`List` does have a `Parallel` instance, and it zips the `List` -insted of creating the cartesian product. +instead of creating the cartesian product. We can see by writing a little bit of code. diff --git a/src/pages/case-studies/crdt/g-counter.md b/src/pages/case-studies/crdt/g-counter.md index 6d413517..f35ae598 100644 --- a/src/pages/case-studies/crdt/g-counter.md +++ b/src/pages/case-studies/crdt/g-counter.md @@ -101,7 +101,7 @@ where we represent machine IDs as `Strings`. ```scala mdoc:reset-object:silent final case class GCounter(counters: Map[String, Int]) { - def increment(machine: String, amount: Int) = + def increment(machine: String, amount: Int): GCounter = ??? def merge(that: GCounter): GCounter = diff --git a/src/pages/foldable-traverse/foldable-cats.md b/src/pages/foldable-traverse/foldable-cats.md index 2116e54c..f596c2f7 100644 --- a/src/pages/foldable-traverse/foldable-cats.md +++ b/src/pages/foldable-traverse/foldable-cats.md @@ -100,7 +100,7 @@ provide stack safe implementations of `foldRight`: (1 to 100000).toVector.foldRight(0L)(_ + _) ``` -We've called out `Stream` because it is an exception to this rule. +We've called out `LazyList` because it is an exception to this rule. Whatever data type we're using, though, it's useful to know that `Eval` has our back.
diff --git a/src/pages/foldable-traverse/foldable.md b/src/pages/foldable-traverse/foldable.md index 576aef44..03479a28 100644 --- a/src/pages/foldable-traverse/foldable.md +++ b/src/pages/foldable-traverse/foldable.md @@ -1,7 +1,7 @@ ## Foldable {#sec:foldable} The `Foldable` type class captures the `foldLeft` and `foldRight` methods -we're used to in sequences like `Lists`, `Vectors`, and `Streams`. +we're used to in sequences like `Lists`, `Vectors`, and `LazyLists`. Using `Foldable`, we can write generic folds that work with a variety of sequence types. We can also invent new sequences and plug them into our code. `Foldable` gives us great use cases for `Monoids` and the `Eval` monad. diff --git a/src/pages/foldable-traverse/traverse-cats.md b/src/pages/foldable-traverse/traverse-cats.md index b4a78c72..dbd40f06 100644 --- a/src/pages/foldable-traverse/traverse-cats.md +++ b/src/pages/foldable-traverse/traverse-cats.md @@ -21,7 +21,7 @@ trait Traverse[F[_]] { ``` Cats provides instances of `Traverse` -for `List`, `Vector`, `Stream`, `Option`, `Either`, +for `List`, `Vector`, `LazyList`, `Option`, `Either`, and a variety of other types. We can summon instances as usual using `Traverse.apply` and use the `traverse` and `sequence` methods diff --git a/src/pages/foldable-traverse/traverse.md b/src/pages/foldable-traverse/traverse.md index 500abc1d..b2146406 100644 --- a/src/pages/foldable-traverse/traverse.md +++ b/src/pages/foldable-traverse/traverse.md @@ -84,7 +84,7 @@ Await.result(allUptimes, 1.second) ``` This is much clearer and more concise---let's see how it works. -If we ignore distractions like `CanBuildFrom` and `ExecutionContext`, +If we ignore distractions like `BuildFrom` and `ExecutionContext`, the implementation of `Future.traverse` in the standard library looks like this: ```scala