Created
March 27, 2018 12:20
-
-
Save mbrandonw/341ac38c6047f07479115ec2c49e0fb4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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