Skip to content

Instantly share code, notes, and snippets.

@edopelawi
Last active October 12, 2016 14:07
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 edopelawi/fe98e9190ed77d45b58584e16ccc8739 to your computer and use it in GitHub Desktop.
Save edopelawi/fe98e9190ed77d45b58584e16ccc8739 to your computer and use it in GitHub Desktop.
A simplified implementation of Swift's Optional, taken from Benedict Terhecte's blog post: https://appventure.me/2015/10/17/advanced-practical-enum-examples/
// Simplified implementation of Swift's Optional
enum MyOptional<T> {
case some(T)
case none
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment