It is my understanding that all these sorted collections rely ultimately on the behaviour of sorted array, which right now is returning nil always for an empty collection, regardless of the default configured value when the collection is instantiated. Besides of returning the default value, also consider adding first_if_empty(&block_closure) and :last_if_empty(&block_closure) and/or allowing to optionally pass an a block to :first and :last in the same manner as :fetch does.
By the way, thanks for publicly sharing this collection of collections in the first place. All of these should be included in the standard library.
It is my understanding that all these sorted collections rely ultimately on the behaviour of sorted array, which right now is returning
nilalways for an empty collection, regardless of the default configured value when the collection is instantiated. Besides of returning the default value, also consider addingfirst_if_empty(&block_closure)and:last_if_empty(&block_closure)and/or allowing to optionally pass an a block to:firstand:lastin the same manner as:fetchdoes.By the way, thanks for publicly sharing this collection of collections in the first place. All of these should be included in the standard library.