RecordFlux
RecordFlux copied to clipboard
Processing/iterating a sequence in a session
I'm trying to sort out how I might process the elements of a sequence in the context of a session. I've tried a couple things but I'm stumped:
- I tried "iterating" through a sequence using list comprehensions and 'Head but since copying sequences isn't yet supported there doesn't seem to be a way to store the Tail of a list to process the remaining elements.
- It appears that sequences can't be used as a function parameter, either directly or as a component of a message type.
The examples in the repo seem to only ever use the 'Head of a sequence to select the first element or some specific element using a list comprehension.
I'd like to be able to call an external function on each element of a sequence.
I suppose a workaround is to write the sequence to a channel and then have the external code re-parse the sequence?