Skip to content

Instantly share code, notes, and snippets.

@endor
Created February 2, 2017 06:31
Show Gist options
  • Save endor/08f9f961ea27251e7ce727df090324e8 to your computer and use it in GitHub Desktop.
Save endor/08f9f961ea27251e7ce727df090324e8 to your computer and use it in GitHub Desktop.
sealed trait Nat
sealed trait Zero extends Nat
sealed trait Succ[N <: Nat] extends Nat
case class A[N <: Nat]()
f1
def f1[N <: Nat]: A[Succ[N]] =
f2
def f2: A[Succ[Zero]] =
new A[Succ[Zero]]()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment