bos/critbit — pull request #61 by isturdy (2013-05-31 18:46:52+00:00)
Title: Fixes for some of the extremity functions.

This started as a project to unite all the extremity updates and deletes under an `updateLookupExtremity` function, but adding the lookup dragged down performance. Along the way, I found that the view and delete functions had the same problem noted in #58, leaving `Empty` internal nodes.

Summary of changes:
* Fixed a handful of excessively lazy benchmarks--both Maybe and (,) need to be evaluated beyond WHNF.
* Fixed a critical bug in the deleteMin/deleteMax family of functions, and rejiggered their hierarchy a bit (making the safe `(min|max)viewWithKey` the primary, rather than the partial `deleteFind(Min|Max)`). Using continuations also saves a bit of time.
* Fixed the analogous bug in `updateExtremity` by making `update(Min|Max)WithKey` primary (with the correct algorithm). This is an alternative to #58; I did not really like how `updateExtremity` left responsibility for maintaining invariants to the caller, and defining the three extra functions does not save code.