У меня две функции .
def process(date: DateTime, invoice: Invoice, user: User, reference: Reference) : (Action, Iterable[Billable])
def applyDiscount(billable: Billable) : Billable
Как я могу составить их так, чтобы у меня была единственная функция (DateTime, Invoice, User, Reference) => (Action, Iterable [Billable])
Вот плохой способ того, что я хочу
def buildFromInvoice(user: User, order: Invoice, placementDate: DateTime, reference: Reference) = {
val ab = billableBuilder.fromInvoice(user, order, placementDate, reference)
(ab._1, ab._2.map(applyDiscount(_))
}