scala/scala — pull request #3226 by ziggystar (2013-12-05 16:16:57+00:00)
Title: add method dequeueOption to immutable.Queue

This allows immutable.Queue to be used conveniently in functional code.
Method is in the spirit of `headOption` on seqs or `get` on maps. Also
adds a unit test for immutable.Queue.

-------------------

Somehow I messed the old pull-request (I'm new to this, so sorry). I decided that it would be easiest to open a new one.

Note that I changed the implementation of `dequeueOption` to use `dequeue`. It is a bit more overhead, but I thought this overhead is dwarfed by the object creations that will happen anyway. So I decided for less code duplication.