
Yes.
I really do consider foldMap to be the canonical form, and both foldr and
foldl to be definable things in terms of it, but for historical reasons
foldMap has a default definition in terms of foldr.
-Edward
On Sun, Sep 21, 2014 at 11:21 AM, Sjoerd Visscher
foldMap is used to provide a 'natural' fold regardless of associativity.
foldMap and foldr are are mutually definable, by using Endo to get foldr from foldMap, or just accepting a right associated monoidal reduction.
This is why foldr or foldMap are the minimal definitions.
However, you can't build foldr in terms of foldl with the right behavior on infinite containers, so foldl is _not_ a viable minimal definition for Foldable in a world where you can have infinitely big things to fold!
Wouldn’t it be the other way around for infinite snoc-lists?
Sjoerd