This is a nice library, but if a Deque is made that might contain nil values, it is impossible to know if the result obtained from Deque.pop is nil because the Deque is empty or because the operation failed.
I think it would be a good idea to also have an ok/error-tuple returning version of Deque.pop, Deque.popleft, Deque.first and Deque.last in the API.
This is a nice library, but if a Deque is made that might contain
nilvalues, it is impossible to know if the result obtained fromDeque.popisnilbecause the Deque is empty or because the operation failed.I think it would be a good idea to also have an ok/error-tuple returning version of
Deque.pop,Deque.popleft,Deque.firstandDeque.lastin the API.