I have a series of functions that accept a function as an argument (func
), and the only difference in them is that func
accepts different numbers of parameters.
def tryGet[T,A](func: (A) => T)
def tryGet[T,A,B](func: (A,B) => T)
... [T,A,B,C...]
Is there a way to make a function accept a function with any length argument list?
I tried using variable length argument lists, eg func:(A*)
but had trouble passing any functions in as it now requires a Seq[A]
.