Skip to content

Instantly share code, notes, and snippets.

@salmaanahmed
Created January 28, 2019 11:25
Show Gist options
  • Save salmaanahmed/eaa44b0030542f62533d25648775f30a to your computer and use it in GitHub Desktop.
Save salmaanahmed/eaa44b0030542f62533d25648775f30a to your computer and use it in GitHub Desktop.
The Result type forces the programmer to explicitly handle the failure and success cases before they can gain access to the actual value.
enum Result<Wrapped, Failure> {
case value(Wrapped)
case error(Failure)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment