SymbolicUtils.jl icon indicating copy to clipboard operation
SymbolicUtils.jl copied to clipboard

Dispatch for FnType Symbolics

Open jpfairbanks opened this issue 1 year ago • 0 comments

It would be really cool to have generic functions in symbolic expressions. Can you overload promote_symype to get that behavior? In my case I have a bunch of functions indexed by a dimension. So I have

abstract type Form <: Number end
struct Form0 <: Form end
struct Form1 <: Form end
struct Form2 <: Form end

d_0(::Form0)::Form1
d_1(::Form1)::Form2
d_2(::Form2)::Form3

and I would like to use d(::Form)::Form to declare all of them and then tell promote symtype the fact that you have to increment the dimension. Is that possible?

Multiple dispatch would also be nice, but could be avoided.

jpfairbanks avatar Aug 04 '24 20:08 jpfairbanks