Exercise 4.72. Why do disjoin and stream-flatmap interleave the streams rather than simply append them? Give examples that illustrate why interleaving works better. (Hint: Why did we use interleave in section 3.5.3?) ———————————————————————————————————————————————————————————————————————— As in 3.5.3, when infinite streams are combined, interleaving is the only way to ensure that each element of each stream will eventually be reached. If the streams were appended, elements of the second stream would never be reached. It's not clear to me whether infinite streams of results would be handled well by the interpreter in any case. It also seems unlikely that infinite streams would be generated except in the case of errors in the database (such as unintentionally recursive rules), though it is possible that the implementation could be extended to use infinite result streams more usefully.