You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description: This Stackoverflow question says, that there are two ways to convert a stream to an array, but in my opinion both of them seem quite verbose.
It would be great to have a stream:toArray() function, which is the opposite of array:toStream() and would convert a stream to an array.
In the documentation of the function it should be noted, that for infinite streams this will loop forever.
What do you think about this?
Suggested Labels:
Code sample that shows issue:
Related Issues:
The text was updated successfully, but these errors were encountered:
I also agree that this would be a good addition. Especially with database clients, we often see functions/query expressions introduced to do just this.
One question is can we write the type for this.
public isolated function toArray(stream<T,E|()>) returns E|T[] = external;
(We do seem to have a bug with stream:reduce type checking in the jBallerina implementation when the completion type is a subtype of error - ballerina-platform/ballerina-lang#43209)
Description:
This Stackoverflow question says, that there are two ways to convert a stream to an array, but in my opinion both of them seem quite verbose.
It would be great to have a
stream:toArray()
function, which is the opposite ofarray:toStream()
and would convert a stream to an array.In the documentation of the function it should be noted, that for infinite streams this will loop forever.
What do you think about this?
Suggested Labels:
Code sample that shows issue:
Related Issues:
The text was updated successfully, but these errors were encountered: