I saw some examples of extension functions being defined inside a class/interface but I didn't understand the reason it would be done. Could someone show when it would be the proper way to implement some use case?
One particular example that I didn't understand very well:
interface Monoid<A> {
fun z(): A
fun A.add(other:A):A
}