Created
June 6, 2017 21:14
-
-
Save janekdb/c07c4f5cec7e4e08bef80ec192325469 to your computer and use it in GitHub Desktop.
Scala Type Level Programming: The Natural Numbers: Exponentiation Assertions
This file contains 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
// 1^0 | |
implicitly[T1#exp[T0] =:= T1] | |
// 1^1 | |
implicitly[T1#exp[T1] =:= T1] | |
// 1^2 | |
implicitly[T1#exp[T2] =:= T1] | |
// 1^3 | |
implicitly[T1#exp[T3] =:= T1] | |
// 2^0 | |
implicitly[T2#exp[T0] =:= T1] | |
// 2^1 | |
implicitly[T2#exp[T1] =:= T2] | |
// 2^2 | |
implicitly[T2#exp[T2] =:= T4] | |
// 2^3 | |
implicitly[T2#exp[T3] =:= T8] | |
// 3^0 | |
implicitly[T3#exp[T0] =:= T1] | |
// 3^1 | |
implicitly[T3#exp[T1] =:= T3] | |
// 3^2 | |
implicitly[T3#exp[T2] =:= T9] | |
// 3^3 | |
implicitly[T3#exp[T3] =:= T27] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment