The trick is not limited to functional programming languages but it is limited to languages that support generic programming / polymorphism