Created
February 5, 2017 13:24
-
-
Save mkchoi212/ab820e144b443313c999640e04ae158a to your computer and use it in GitHub Desktop.
Simple generic version of result enums
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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