Suppose,I have a function, take two values and a function as parameters.
def ls[S](a: S, b: S)(implicit evl: S => Ordered[S]): Boolean = a < b
def myfunction[T](a: T, b: T, f:(T,T)=>Boolean) = {
if (f(a, b)) {
println("is ok")
}
else {
println("not ok")
}
}
myfunction(1, 2, ls)
the IDE don't give any error message,but when I try to compile and run,the compliter give this message:
Error:(14, 19) No implicit view available from S => Ordered[S].
myfunction(1, 2, ls);}
^
So,is there a way to pass type parameter function as a parameter of another function ?