foldr c n (Coyoneda k a) = foldr (c . k) n a
foldl f b (Coyoneda k a) = foldl (\acc -> f acc . k) go b a
-- foldl', foldr', foldl1, foldr1 similarly
toList (Coyoneda k a) = map k (toList a) -- but this is arguably worse than the default!
length (Coyoneda _ a) = length a
null (Coyoneda _ a) = null a
Unfortunately, I don't believe it's possible to do anything about fold, maximum, minimum, sum, product, or elem.
In particular:
Unfortunately, I don't believe it's possible to do anything about
fold
,maximum
,minimum
,sum
,product
, orelem
.