Skip to content

Instantly share code, notes, and snippets.

@AppleCEO
Created June 13, 2019 12:12
Show Gist options
  • Select an option

  • Save AppleCEO/afcc7b9bc066781490c528981041c887 to your computer and use it in GitHub Desktop.

Select an option

Save AppleCEO/afcc7b9bc066781490c528981041c887 to your computer and use it in GitHub Desktop.
Set is functor
let set:Set = [1, 2, 3, 4, 5]
let setReturned = set.map({ (number: Int) -> Int in
let result = 2 * number
return result
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment