Add type mixins to overcome subtype limitations

It could also be helpful to have an abstract helper type for all types that have a noise field:

abstract MakesNoise

volume(x::MakesNoise) = x.noise.loud ? 20 : 10

make_some_noise(x::MakesNoise) = play(Sound(x.noise.sound), volume(x))

Then you could make Dog <: MakesNoise and Cat <: MakesNoise and “paint” noise-related method onto those types. The main limitation here is that types can’t inherit from multiple abstract types – which is a limitation we’ve been aware of for some time.