From d6064c3b28555db5ca767d59c3ffd11323cf565f Mon Sep 17 00:00:00 2001 From: Steven Scott Date: Wed, 18 Sep 2019 11:28:10 -0400 Subject: [PATCH] Update Semigroup docs for Map I didn't understand that the values in Maps were also combined when two maps are combined - I thought the `"hello" -> 2` entry was simply _replacing_ the `"hello" -> 0` entry in the first map. Giving the first map's `"hello"` a value of `1` results in the combined map having a `"hello" -> 3` entry, showing that the values were combined. After understanding that, I realized why my code couldn't find an implicit `Semigroup` for my Map - I didn't have an implicit `Semigroup` for my map's values. --- docs/src/main/tut/typeclasses/semigroup.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/main/tut/typeclasses/semigroup.md b/docs/src/main/tut/typeclasses/semigroup.md index ee5b6b7de8..8f437dc756 100644 --- a/docs/src/main/tut/typeclasses/semigroup.md +++ b/docs/src/main/tut/typeclasses/semigroup.md @@ -58,7 +58,7 @@ for `Map`s. ```tut:book:silent import cats.implicits._ -val map1 = Map("hello" -> 0, "world" -> 1) +val map1 = Map("hello" -> 1, "world" -> 1) val map2 = Map("hello" -> 2, "cats" -> 3) ```