0

I have higher order function:

def calculateFusionRiskContract(postCalc: DataFrame => DataFrame) 

How i can set default value for postCalc parameter that just return parameter of postCalc? without any calculation?

def calculateFusionRiskContract(postCalc: DataFrame => DataFrame = ???) 

1 Answers1

6

The function that "just returns the parameter" is identity

def calculateFusionRiskContract(postCalc: DataFrame => DataFrame = identity) = ???

Is there a scala identity function?

Dmytro Mitin
  • 48,194
  • 3
  • 28
  • 66