Create a collection of functions tupled with a collection of parameters, and execute the collection in order in Scala
Unless I misunderstand your question, I think this is what you want:

type Subroutine[Param] = Param =&gt; Any

type Routine = Seq[(Subroutine[_], Seq[Any])]

def execRoutine(routine: Routine): Unit = routine foreach { case (sub, params) =&gt; execSubroutine(sub, params) }

def execSubroutine[SubParam] (subroutine: Subroutine[SubParam], params: Seq[Any]): Unit = {
    require(params.nonEmpty)

    subroutine(params.head.asInstanceOf[SubParam]) match {
        case sub: Subroutine[_] =&gt; execSubroutine(sub, params.tail)
        case () =&gt; require(params.tail.isEmpty) // Require correct number of params.
        case _ =&gt; throw new IllegalStateException()
    }
}

val add2 = (a: Int) =&gt; (b: Int) =&gt; println(a + b)
val add3 = (a: Int) =&gt; (b: Int) =&gt; (c: Int) =&gt; println(a + b + c)

execRoutine(List(
    (add2, List(3, 4)),
    (add3, List(3, 4, 5))
))


Try it online!

This program prints 7 and 12. Unfortunately, if the parameters are of the wrong type, a runtime exception occurs instead of a compile time one. Attempting to apply the less or more than the required parameters also results in a runtime exception.