How can i write a isFunction function in scala, so that this works:
def isFunction(x:Any) = /* SomeCode */ println(isFunction(isFunction _)) //true println(isFu
Quite ugly, but it works:
def isFunction(x:Any) = x match { case _: Function0[_] => true case _: Function1[_, _] => true case _: Function2[_, _, _] => true ... case _: Function22[...] => true case _: PartialFunction[_, _] => true case _ => false }