Open tomjaguarpaw opened 6 years ago
I'm confused as to what the actual benefit is here - mainly because I think I misunderstand you. What does "consume their arguments sequentially" mean? What are the arguments here? Arguments to the functions defined in streaming
? What does sequentially
mean? The way it's worded makes it seem to refer to the arguments, but I'm not sure what arguments is, so that doesn't exactly make sense. Do you mean 'linearly' instead of 'sequentially'?
The easiest way to understand what I mean is to look at the code. There exists a function fold
such that many of the standard streaming
functions are fold . f
for some f
.
Many
streaming
functions factor through a "fold" that guarantees that they consume their arguments sequentially and transform them with monad homomorphisms before re-emitting them. (cf. foldMap). Is this style something you're interested in pursuing, either internally or in the public API?