KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Why can't I do this: def compare[A <% { def toInt: Int }, B <% { def toInt: Int }] (bs: Seq[A], is: Seq[B]): Boolean = { bs.toArray.zip(is) forall { p => p._1.toInt == p._2.toInt } } In order to compare any Sequence of types convertible to Int ? How can I implement a similar pattern? Update: this should run Message.compare(List(1.0, 2.0, 3.0), List(0, 0, 0))
Tags (comma-separated)
Save Edits
Cancel