anchor.diff:  ;;; TODO Allow the heap to have variable arity?
   ;;; http://www.pvk.ca/Blog/2014/04/13/number-systems-for-implicit-data-structures/
   
  +(deftype heap ()
  +  '(vector t))
  +
   (defsubst heap-parent (i)
  +  (declare (array-index i))
     (ash (1- i) -1))
   
   (defsubst heap-left (i)
  +  (declare (array-index i))
     (1+ (ash i 1)))
   
   (defsubst heap-right (i)
  +  (declare (array-index i))
     (+ 2 (ash i 1)))
   
   (defun heapify (heap start &key (key #'identity) (test #'>=))
  -  (declare (function key test))
  +  (declare (function key test)
  +           (array-index start)
  +           (heap heap))
     (fbind (key (ge test))
  +    (declare (ftype (-> (t) t) key)
  +             (ftype (-> (t t) t) ge))
       (let ((l (heap-left start))
             (r (heap-right start))
             (size (length heap))
  
positive.code:     heap))
  
  (defun heap-insert (heap new-item &key (key #'identity) (test #'>=))
    (declare (function key test))
    (fbind (key (ge test))
      (vector-push-extend nil heap)
      (loop for i = (1- (length heap)) then parent-i
  
negative.code:                   (return-from heap-insert i))))
  
  (defun heap-maximum (heap)
    (declare (heap heap))
    (unless (zerop (length heap))
      (aref heap 0)))
  
  (defun heap-extract (heap i &key (key #'identity) (test #'>=))
    (declare (heap heap) (array-index i))
    (unless (> (length heap) i)
      (error "Heap underflow"))
    (prog1
  