Suppose I have the following:
fun makeSound(val animal: Animal) = when(animal) {
is Lion -> animal.roar()
is TRex -> animal.roar()
is Cow -> animal.moo()
}
Usually I would simplify this by simply adding a RoaringAnimal interface and asking is RoaringAnimal. But is there another way of combining multiple is clauses into one?