Documentation of Foldable1.foldrMap1 and friends could be better
Summary
The documentation of the newly added Foldable1.foldrMap1
(seen at https://ghc.gitlab.haskell.org/ghc/doc/libraries/base-4.18.0.0/Data-Foldable1.html) simply says Generalized foldr1
. I feel this could be better. At the very least it should make it clear that a -> b
is to be applied to the rightmost element, since the foldr1
it refers to does not help with this.
The documentation of Foldable1.foldr1
on the other hand is pretty good. But it explains with an example of a list, which is not a Foldable1
! This should perhaps use a NonEmpty
.
The above also applies to foldlMap1
and foldl1
.