Skip to content

Instantly share code, notes, and snippets.

@mbrandonw
Created March 27, 2018 12:20
Show Gist options
  • Save mbrandonw/341ac38c6047f07479115ec2c49e0fb4 to your computer and use it in GitHub Desktop.
Save mbrandonw/341ac38c6047f07479115ec2c49e0fb4 to your computer and use it in GitHub Desktop.
enum StringOrInt {
case string(String)
case int(Int)
}
func isInt(_ stringOrInt: StringOrInt) -> Bool {
switch stringOrInt {
case .string: return false
case .int: return true
}
// no return needed
}
func absurd<A>(_ never: Never) -> A {
switch never {
}
// no return needed
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment