4 ms·
> Which programming languages have a strong enough type system to do this? Besides the other mentions Scala 3 has type level arithmetic built in. Quick peek:
by still_grokking 4y ago
> Which programming languages have a strong enough type system to do this?
Besides the other mentions Scala 3 has type level arithmetic built in.
Quick peek:
https://gist.github.com/deanwampler/b1176dc939abc092681368c9aa8dafb5#file-scala3-DependentTypes-IntAlgebra-scala https://gist.github.com/deanwampler/b1176dc939abc092681368c9...
You could do things like that also in Scala 2. But the code to make it work would be quite involved.