Skip to content

Instantly share code, notes, and snippets.

@hartbit
Created January 28, 2015 08:59
Show Gist options
  • Save hartbit/e492376a8851ea6586a8 to your computer and use it in GitHub Desktop.
Save hartbit/e492376a8851ea6586a8 to your computer and use it in GitHub Desktop.
extension Nat: IntegerLiteralConvertible {
init(integerLiteral value: IntegerLiteralType) {
switch (value) {
case 0:
self = .Zero
default:
self = .Succ(Nat(integerLiteral: value - 1))
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment