4 May
2017
4 May
'17
5:30 p.m.
Ay, there's the rub. Traversable over (,) can be expressed as a fold over a single element, but that doesn't mean it should be. All you want in this case is the effect. From: Nickolay Kudasov <nickolay.kudasov@gmail.com> Sent: 04 May 2017 08:16Subject: Re: [Haskell-cafe] Foldable for (,) .... It turns out that by using Const applicative functor you can use traverse to perform foldMap! Thus every Traversable is trivially a Foldable (see foldMapDefault). Similarly, every Traversable is trivially a Functor if you use Identity applicative functor (see fmapDefault). This is why Traversable has those Functor and Foldable constraints, not because it relies on fmap or foldMap.