From 25cfda360aa1b34ec98a255ca3e7f9957bb4eb90 Mon Sep 17 00:00:00 2001 From: Lionel Parreaux Date: Mon, 16 Sep 2019 13:03:43 +0200 Subject: [PATCH] Link to relevant Const doc from doc of Traverse --- 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.