copilot
copilot copied to clipboard
Defining Stream (Array 2 Double) from 2 Stream Double
If I have 2 streams carrying doubles, such as:
x :: Stream Double
x = extern "x" Nothing
y :: Stream Double
y = extern "y" Nothing
Is it possible to define, with some function (or maybe an Op2
):
xy :: Stream (Array 2 Double)
xy = ??? x y
Currently there is no way to construct an array from stream carrying scalars. Having a feature like this (and a similar one for structs) would indeed help a lot, and is worth looking into.
I wouldn't know how to go about it. I'm thinking about kinds and arities, but I'm not sure we could make it work.
Update: Someone is working on a feature atm that would allow us to implement this.
Update: @InnovativeInventor has implemented 'set' or 'update' for arrays, which allows us to implement this. We'll be discussing integrating this into Copilot in the upcoming future.
Update: similar requests have come up recently related to structs. We are looking into porting the solution that @InnovativeInventor prepared to work for structs and adding both to Copilot. Stay tuned.