Sometimes I want to print custom outputs from certain classes.
data class Foo(val key: Int, val value: List<Int>) {
override fun toString(): String { // pp() doesn't use this!
return "#Foo($key => $value)"
}
}
I wish I can override what pp() uses to format class instances, for example by implementing some interface.
(overriding fun pp() is an option too, but I think it is not the best, because the implementer needs not to forget newlines)