Coming from a C#/F#/Haskell/Mathematica background, I have to say my heart beats with bliss upon such sights of ugliness that plague languages I deliberately chose to keep away from after brief initial exposure, such as Java/Scala ^_^! There is no god in heavens that would not pity the ones that suffer such mess on a daily basis.
–
Cetin SertSep 9 '11 at 0:00

1

@Cetin: In Scala, generic math is ugly. But it can do generic math. C#, F# cannot even do generic math in a typesafe manner. Mathematica being a dynamically typed language, the comparison doesn't make sense.
–
missingfaktorSep 14 '11 at 19:26

4 Answers
4

You are using the Int literal 2 but scala is expecting the Numeric type A.
The Scala Numeric API has a utility function- def fromInt(x:Int): T. This is what you want to use, so replace your usage of 2 with numeric.fromInt(2)

Dylan essentially answered, but for what it's worth, let me suggest to use the context bound syntax instead of the implicit argument (both are equivalent, and the former is automatically rewritten into the latter by the compiler).