I am trying to use the streaming package for lazy list operations demonstrated in this post. But I found that the package was significantly changed in version 11. After some observations, I found that LazyRange
was moved to Streaming`ListAPI`Lazy`LazyRange
, etc. However I encountered two problems in trivial tasks.
- Converting a lazy list to list. Leonid's post suggested
Normal
, which points to functionStreaming`ListAPI`Eager`LazyListToList
(this mapping is contained inStreaming`ListAPI`General`$StreamingAPIRegistry
). Consider the following example:
ll = 2 # & /@ Streaming`ListAPI`Lazy`LazyRange[Infinity];
fl = Take[ll, 100];
(*part works correctly*)
fl[[10]]
(*20*)
Normal[fl]
(*long unexpected expression*)
Streaming`ListAPI`Eager`LazyListToList[fl]
(*same long unexpected expression*)
- Making a lazy tuple. I suppose it is similar(same) to Leonid's implementation here, however, both his example and ordinary syntax fail.
Streaming`ListAPI`Lazy`LazyTuples[{{1}, {2}}]
(*some uncaught errors*)
How to achieve the two tasks mentioned above?