On Tue, Feb 10, 2015 at 12:34 AM, Keean Schupke <[email protected]> wrote:
> In general collections need to be mutable to be 'pushed' into. Only the > special case of a singly linked list (or some trees with no backlinks) is > this possible. > Does it follow that comprehensions are a non-pure concept? Or does the rewrite rely on a monad? I'm still not convinced that we want to think of the output as a collection. An output collection is certainly one option, but it seems to me that the real requirement is the ability to implement something equivalent to "append". So, for example, a vector as output is (inefficiently) possible if we are willing to build a new vector for each element, increasing the length by one each time we "append" an element. A vector clearly isn't a collection. I don't mean to suggest that this is the "right" way to do it. I'm only trying to point out that we don't need to rely on mutation to make comprehensions work. shap
_______________________________________________ bitc-dev mailing list [email protected] http://www.coyotos.org/mailman/listinfo/bitc-dev
