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 …
-
-
Dimension-checked matrices has been my dream ever since wasting days of research effort due to my garbage python code. I didn't need statically-unknown dimensions. But maybe we could have symbolic variables and then maybe use symbolic math? Shell out to sympy?
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Yeah, having to encode associativity/commutativity of addition and multiplication in the compiler to ensure (a.size + 5) =:= (5 + a.size)...
-
At least I guess that's what it would take
- Show replies
New conversation -
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.