Day 18 of Learning Kotlin

Did one exercise from Joy of Kotlin. This 90 day journey is losing its shine and feeling like a chore. However, these thoughts don’t last long as they are just that. Everything is all right. Just show up and see what happens.

package day18
// Exercise 3.3

val add: (Int) -> (Int) -> Int = {a -> { b -> a+b}}

fun main(args: Array<String>) {
println(add(1)(2))
}

add is a value function that takes and Int and returns a function that takes an Int and returns an Int.