
21 Jun
2018
21 Jun
'18
6:30 a.m.
On 06/21/2018 05:13 AM, Jon Fairbairn wrote:
Suppose I’m writing some code using Conduits, but need to use some old function f::[a]->[b] (defined in a library somewhere) that transforms a lazy list.
Is there a way of turning f into a Conduit without ending up with all of the list being in memory?
Constructing a list in such a streaming fashion only seems possible with unsafePerformIO trickery: define the input list lazily by reading a mutable reference, which gets populated whenever the conduit 'await's a new value. Li-yao