Can I use arrow meta to change generics on types b...
# arrow-meta
r
Can I use arrow meta to change generics on types before code analysis?
r
Are the calculated types already in the AST as if the user or source codegen typed them?
If that is the case you can use the quote system to transform the sources before analysis
If you need the type checked info then you can modify the IR tree with the meta DSL but at that point it would have to be already valid Kotlin and for what I understood earlier the issue is that it does not typecheck
You can also.alter the type checker like the type proofs system does in meta in the sv-test-proofs branch
To actually make it type check if you know it's right
The ProofsPlugin does that for all type relationships that are proven to have a morphism between them.
r
Where can I find code for ProofsPlugin?
Using a custom typechecker like that one you could tell the compiler those typecheck then you have to provide a cast or something in IR where the impossible cast would happen
Or replace the types in quotes before typechecking if you don't want to deal with the typechecker
Did you have to build or create some kind of HList in your library for dimensions or does it include any predicates like AllOf where you have arity of N type parameters ?
r
In the few locations in the linear algebra library where a concrete instance was required, the numeric superclass enforced a
val i: Int
in subclasses, just used that
👍 1
Also, is there somewhere I can find example uses of Proofs? @raulraja
r
The prelude module is full of proofs for union types etc
The syntax can be seen exercised in the tests of the compiler-plugin module
Sorry, on my phone or I'd provide links