Skip to content

Instantly share code, notes, and snippets.

@deda9
Created June 25, 2019 14:47
Show Gist options
  • Save deda9/dc78ec83c64dccbfd2a8d37baeea40a0 to your computer and use it in GitHub Desktop.
Save deda9/dc78ec83c64dccbfd2a8d37baeea40a0 to your computer and use it in GitHub Desktop.
How to create nested function
let multiply: (Int, Int) -> Int = { $0 * $1 }
let divide: (Int, Int) -> Int = { $0 / $1 }
let minus: (Int, Int) -> Int = { $0 - $1 }
minus(multiply(divide(10,2), 2), 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment