scala - missing parameter type in lambda -
i have following in worksheet:
val tarr = array((1, some(1.0)), (2, some(6.0))) val r1 = tarr exists function.tupled((_, sf: option[double]) => sf == none)
the ide complays missing parameter type
_
worksheet spits out desired result.
if plug same line of code in package , compile, compilation stops with, again, missing parameter type
both _
, sf
i bit confused on why need specify type there , why worksheet works , compilation no.
in eclipse ide, code works fine
object yrd { val tarr = array((1, some(1.0)), (2, some(6.0))) //> tarr : array[(int, some[double])] = array((1,some(1.0)), (2,some(6.0)))
val r1 = tarr exists function.tupled((_, sf: option[double]) => sf == none) //> r1 : boolean = false
}
Comments
Post a Comment