Pattern matching, Traits