Queue modification functions do not return Queue.t


#1

Is there a reason that the modification functions (e.g. add, take, etc) in the Queue module do not return a new Queue.t object? For example, Queue.add returns unit instead of Queue.t.

This seems inconsistent with (and less functional than) the List and Array modules that return a fresh object after each modification function.


#2

Nevermind. It looks like this functionality is inherited from OCaml queues. (https://ocaml.org/learn/tutorials/comparison_of_standard_containers.html)


#3

It’s actually IS ocaml stdlib’s Queue module