Thanks, that is good to know.
I guess I have the perspective that folds are just catamorphisms. So I find foldr
very natural for lists (not for other data structures). Other functions like foldr1
and foldl
are just special cases of foldr
.
Now that I’m thinking more about Foldable
, I’m also missing functions like foldMap :: Semigroup m => (a -> m) -> Infinite a -> m
and fold :: Semigroup m => Infinite m -> m
. I guess an argument against adding those is that there are not that many semigroups for which these will terminate.