From f727b5d03ce87128ad5eab211ba206d8af1e8774 Mon Sep 17 00:00:00 2001 From: Lionel Parreaux Date: Mon, 16 Sep 2019 14:59:04 +0100 Subject: [PATCH] Link to relevant Const doc from doc of Traverse (#3065) --- docs/src/main/tut/typeclasses/traverse.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/src/main/tut/typeclasses/traverse.md b/docs/src/main/tut/typeclasses/traverse.md index 99fd30a38c..fd1277a1a4 100644 --- a/docs/src/main/tut/typeclasses/traverse.md +++ b/docs/src/main/tut/typeclasses/traverse.md @@ -160,6 +160,8 @@ def foldMap[F[_]: Traverse, A, B: Monoid](fa: F[A])(f: A => B): B = Traverse[F].traverse[Const[B, *], A, B](fa)(a => Const(f(a))).getConst ``` +This works because `Const[B, *]` is an `Applicative` if `B` is a `Monoid`, as explained in [the documentation of `Const`](const.html#example-2-traverse). + ## Further Reading * [The Essence of the Iterator Pattern][iterator] - Gibbons, Oliveira. JFP 2009.