Generic functions vs mixins: a case study