score:0

i would try pattern matching with guard conditions, as an example:

def concat[a](a: seq[a]) = {
    a match {
        case(h::_) if h.isinstanceof[int] => // do multiply and return as ....
        case(h::_) if h.isinstanceof[string] => // do concat and return as ....
        case _ => throw new nosuchelementexception
    }
}

Related Query

More Query from same tag