I don’t think this is true? push!(channel, x)
is just a thin wrapper of put!(channel, x)
In my mind all collections define push!
should define append!
; i.e., I expect append!(a, b) = foldl(push!, b; init = a)
to be always a valid definition. Since Channel
already defines push!
, I think it’s natural to have append!
.
Yes, I agree that’s probably the best first step. I expect it’d cover “90%” of use cases. We can worry about generalization later.
Another fun special case that could be optimized (and perhaps we’d need to worry about) is append!(::Channel, ::Channel)
.