Skip to content

Instantly share code, notes, and snippets.

@macbaszii
Created August 24, 2015 05:46
Show Gist options
  • Select an option

  • Save macbaszii/e442ec71ad1ef16e8101 to your computer and use it in GitHub Desktop.

Select an option

Save macbaszii/e442ec71ad1ef16e8101 to your computer and use it in GitHub Desktop.
func map<U>(f: T -> U) -> U? {
switch self {
case .Some(let x): return f(x)
case .None: return .None
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment