Implement 'Foldable' on NonEmpty
Yes, you can. Given that foldr is right-associative, your implementation is incorrect. Intuitively, foldr will recurse down a structure until it bottoms out and then will it start accumulating the result by going back up. So, this version would be more appropriate:

foldr f acc (NonEmpty a as) = f a (foldr f acc as)


In fact your version is a correct foldl:

foldl f acc (NonEmpty a as) = foldl f (f acc a) as


I think your version of foldMap is fine given the associativity of the monoidal operation.