anchor.diff:      module DHeap = 
   
           /// Return the number of entries in the dheap priority queue
  -        let size dheap = 
  +        let size (dheap: DHeap<'T>) : int = 
               dheap.Heap.Count
   
           /// Is the dheap priority queue empty
  -        let isEmpty dheap = 
  +        let isEmpty (dheap: DHeap<'T>) : bool = 
               dheap.Heap.Count = 0
   
   
           /// Convert a power of two number into its value as a power of two integer exponent
  -        let private asPowerOfTwoExponent n = 
  +        let private asPowerOfTwoExponent (n: int) : int = 
               Math.Log(float n, 2.0) |> int
       
           /// Extract the capacity value or return a default.
  -        let private capacityValue capacity = 
  +        let private capacityValue (capacity: Capacity) : int = 
               match capacity with
               | Capacity(cap) -> int cap 
               | DefaultCapacity -> 16
   
           /// Return the arity of a tree node in the heap as an integer
  -        let private arityToInteger arity = 
  +        let private arityToInteger (arity: HeapArity) : int = 
               match arity with
               | Binary -> 2
               | Quaternary -> 4
  
positive.code:             | TerDenBinary -> 32                       
         
          /// For a key identified by its index `n` in the heap, return the index of that key's kth child.
          let private indexOfKthChild dheap n k =         
              (n <<< dheap.TreeNodeChildCountAsPowerOfTwoExponent) + k
  
          /// For a key identified by its index `n` in the heap, return the index of its parent.
          let private indexOfParent dheap n =              
              (n - 1) >>> dheap.TreeNodeChildCountAsPowerOfTwoExponent // note this will not work if passed index 0, the root index of the heap tree (which is guarded against)
  
          /// Exchange the positions of two elements specified by index in the heap's array 
          let private swap dheap index1 index2 = 
              let tmp = dheap.Heap.[index1]
              dheap.Heap.[index1] <- dheap.Heap.[index2]
              dheap.Heap.[index2] <- tmp
  
          /// Is the element at index1 higher priority than the element at index2
          let private isHigherPriority dheap index1 index2 = 
              let elem1 = dheap.Heap.[index1]
              let elem2 = dheap.Heap.[index2]
              dheap.IsHigherPriorityComparer elem1 elem2
  
          /// Return highest priority child index of a parent 'index'
          let private highestPriorityChildIndex dheap index =
              let firstChildIndex = indexOfKthChild dheap index 1
              let lastChildIndex = indexOfKthChild dheap index dheap.TreeNodeChildCount
              let heapSize = (size dheap)
  
negative.code:                 fail EmptyHeap
      
                  
      let minBinaryHeap : (unit -> DHeap<'T>) = fun _ -> DHeap.empty Binary MinKey DefaultCapacity 
      let maxBinaryHeap : (unit -> DHeap<'T>) = fun _ -> DHeap.empty Binary MaxKey DefaultCapacity
      let minQuaternaryHeap : (unit -> DHeap<'T>) = fun _ -> DHeap.empty Quaternary MinKey DefaultCapacity 
      let maxQuaternaryHeap : (unit -> DHeap<'T>) = fun _ -> DHeap.empty Quaternary MaxKey DefaultCapacity 
  
      let minBinaryHeapWith (items: seq<'T>) : DHeap<'T> = DHeap.ofSeq Binary MinKey DefaultCapacity items
      let maxBinaryHeapWith (items: seq<'T>) : DHeap<'T> = DHeap.ofSeq Binary MaxKey DefaultCapacity items
      let minQuaternaryHeapWith (items: seq<'T>) : DHeap<'T> = DHeap.ofSeq Quaternary MinKey DefaultCapacity items
      let maxQuaternaryHeapWith (items: seq<'T>) : DHeap<'T> = DHeap.ofSeq Quaternary MaxKey DefaultCapacity items
  
  
  
  