I had a go at modifying the Scala 3 type system to support inline arithmetic in singleton literals. The compiler will now typecheck this: import compiletime._ the[(2 + 2)*2 =:= 5 + 3] https://github.com/propensive/dotty/tree/typelevel-singleton-literal-type-arithmetic …
-
Show this thread
-
Replying to @propensive
awesome stuff, imagine if we could get the size of a List and add these safely...
1 reply 0 retweets 3 likes -
Replying to @kubukoz
That's pretty easy to do. I'll post my (propensive/dotty-only) code sample of dimension-checked matrices tomorrow.
1 reply 0 retweets 4 likes -
Replying to @propensive @kubukoz
The huge challenge, I think, is going to be dealing with interactions between lists of statically-known and statically-unknown length.
2 replies 0 retweets 4 likes -
Replying to @propensive
Yeah, having to encode associativity/commutativity of addition and multiplication in the compiler to ensure (a.size + 5) =:= (5 + a.size)...
1 reply 0 retweets 0 likes -
Replying to @kubukoz @propensive
At least I guess that's what it would take
1 reply 0 retweets 0 likes
Replying to @kubukoz
I think that that part of it isn't the worst...
7:43 AM - 16 Jun 2019
0 replies
0 retweets
1 like
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.