Thanks for this discussion. I’ve often wondered about the utility of :queue myself. It seems easy enough to use lists for this with the understanding that enqueueing would be expensive.
#enqueue
q = 1..5 |> Enum.reduce([], fn i, q -> q ++ [i] end)
#dequeue
[hd | new_q] = q
I suspect this only matters beyond a certain size, which is where :queue becomes important.


















