I have a sequence of operations, and the results are packed in a tuple to be given as a parameter to a method.
val bs = byteArrayToBitSet(ba)
val d = bs.filter(_ < dBits)
val c = ...
val b = ...
val a = ...
val r = (f(a), f(b), f(c), f(d)) // <--
((fn _).tupled)(r)
I'd like to modified the tuple generation code something like this:
val r = List(a,b,c,d).map(f(_)) // returns List not tuple
I need to change the List into tuple in order to use ((fn _).tupled)(r)
. How can I do that?
I may come up with a new method that gets List as an input if there is no way to convert list into tuple, but I'd like to have the tuple solution if possible.