Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save janekdb/ce1cf333140f4092b46f61566867fd19 to your computer and use it in GitHub Desktop.
Save janekdb/ce1cf333140f4092b46f61566867fd19 to your computer and use it in GitHub Desktop.
Scala Type Level Programming: The Natural Numbers: High Hex
sealed trait Nat {
type inc <: Nat
type dbl <: Nat
type A = this.type#dbl#inc#dbl#dbl#inc#dbl
type B = this.type#dbl#inc#dbl#dbl#inc#dbl#inc
type C = this.type#dbl#inc#dbl#inc#dbl#dbl
type D = this.type#dbl#inc#dbl#inc#dbl#dbl#inc
type E = this.type#dbl#inc#dbl#inc#dbl#inc#dbl
type F = this.type#dbl#inc#dbl#inc#dbl#inc#dbl#inc
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment