type inference still need enhance,any better suggestion for this example?
- by iamsungod
for instance in Clojure:
user=> (map #(* % 2) (concat [1.1 3] [5 7]))
(2.2 6 10 14)
but in Scala:
scala> List(1.1,3) ::: List(5, 7) map (_ * 2)
<console>:6: error: value * is not a member of AnyVal
List(1.1,3) ::: List(5, 7) map (_ * 2)
^
Here ::: obtain a list of type List,oops then failed. Can any coding more intuitively like Clojure above?