A bit of functional double dispatch.