I'm trying to assign a lambda expression to the following variable:
val aba : ((Int) -> Double) -> ((Int) -> Double)
the way I am trying to:
aba = {(b: (Int -> (Double))-> {x: Int -> 5 - 2 * b(x)} }
but i'm getting different errors like:
- Expecting comma or ')' (from compiler)
- Destructing declaration initializer of type (int) -> Double must have a component1() function (from editor)
I know that if i will omit (Int -> (Double) and leave only b it works:
aba = {b -> {x: Int -> 5 - 2 * b(x)} }
But why can't I explicitly write the parameters? Some can tell me what is the problem?