Skip to content

Instantly share code, notes, and snippets.

@mkchoi212
Created February 5, 2017 13:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mkchoi212/ab820e144b443313c999640e04ae158a to your computer and use it in GitHub Desktop.
Save mkchoi212/ab820e144b443313c999640e04ae158a to your computer and use it in GitHub Desktop.
Simple generic version of result enums
enum Result<T> {
case Success(T)
case Error(ErrorType)
}
// Example function signitures
func findUserAddress(name: String) -> Result<String>
func findUserAge(name: String) -> Result<Int>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment