Generic programming for Scala