Yes, that could be interesting. I assume you thought about numeric integration, not symbolic/algebraic?
Actually, this design is quite complex, as the Integrate part would have to evaluate the function multiple times in its own single evaluation step. While this would work fine with a classic approach, it could become tricky here. That's fine, as it might show some weaknesses of the current yttrium architecture (that hopefully can be fixed)...
About supporting various input data types: this is an important point of the yttrium architecture: you may change the input type any time, the engine automatically loads an architecture that can handle this type (however, you may loose state - obviously). You may also design the architecture to support a more general data type, e.g. any type with a special algebraic structure (e.g. Field, or VectorSpace), or to make it invariant, so it accepts any input types.
In yttrium you may construct architectures manually, but they're usually automatically created for you, so configuring it in the constructor may be problematic (if you don't want to abandon this automatic construction). Alternatively, you could configure it with a special config input signal.
Btw, what I had in mind about integration up to now:
- Various (classical) numeric integration algorithms in Iridium (in the MathNet.Numerics.Integration namespace) (no Yttrium)
- Symbolic Integration for Yttrium, in the Std-package, similar to the Diff/Derive implementation
- Integration in a signal processing style, in the (Yttrium-based) Neodym Project. (Direct, maybe also a "running window" version)
The last one (Neodym) looks similar to your idea, but is online instead of offline. That is, you just feed it with timed samples and it returns the current "running integral".
Neodym A:
+-----------+
+ Integrate +
Signal Source +-----------+ "Current Running Integral"
------------------>| in out |>--------------------------------->
| |
+-----------+
Neodym B:
+-------+ +--------+ +-----------+
+ Clock + + Signal + + Integrate +
Frequency +-------+ +--------+ +-----------+
------+------>| tick |>---->| clk | | |
| +-------+ | out |>------>| in | Running Integral
+--------------------->| f | | out |>--------------------->
| +--------+ | |
+--------------------------------------->| f |
+-----------+
Neodym C:
+-------+ +--------+ +--------+ +-----------+
+ Clock + + Signal + + Window + + Integrate +
Frequency +-------+ +--------+ +--------+ +-----------+
------+------>| tick |>---->| clk | | | | |
| +-------+ | out |>------>| in | | vector |
+--------------------->| f | | vect |>---->| in out |>-->
| +--------+ +--------+ | scalar |
+------------------------------------------------------->| f |
+-----------+