sliquister/batteries-included — comment on commit e951adcc1770d201665face692156c53c462957c
File: src/batDeque.ml line 63
By sliquister:

If you remove the ```{rear = []} -> None``` and change the end of the function (starting with Some (List.hd front ...)) by:

match front with
| [] -> None
| hd :: front -> Some (hd, {front = front; ...})

It should work just fine. In my opinion, by adding a match case for the rear of length one (and of length zero) you speed them up, but you slow every other operations because there is one more match to do. And the other operations happen much more often.

For now, I won't do benchmarks, I'll concentrate on fingertrees.