copilot icon indicating copy to clipboard operation
copilot copied to clipboard

Defining Stream (Array 2 Double) from 2 Stream Double

Open ghost opened this issue 5 years ago • 5 comments

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

ghost avatar Jul 08 '19 17:07 ghost

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.

fdedden avatar Jul 09 '19 20:07 fdedden

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.

ivanperez-keera avatar Jul 10 '19 00:07 ivanperez-keera

Update: Someone is working on a feature atm that would allow us to implement this.

ivanperez-keera avatar Jul 08 '23 17:07 ivanperez-keera

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.

ivanperez-keera avatar Aug 06 '23 21:08 ivanperez-keera

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.

ivanperez-keera avatar Dec 12 '23 17:12 ivanperez-keera