anchor.diff:      let inline height (t : Diet<'T>) =
           AvlTree.height t
   
  +    // For debugging purposes.
  +    let internal ensureCorrectlyFormed (measurer : IMeasurer<_>) (tree : Diet<'T>) =
  +        let rec ensureCorrectlyFormed tree =
  +            match tree with
  +            | Empty
  +            | Node (_, Empty, Empty, _) -> ()
  +            | Node (rangeXY : Range<_>,
  +                    (Node (leftChildRange : Range<_>,_,_, leftChildHeight) as left), Empty, height) ->
  +                // Make sure the sets aren't overlapping or touching,
  +                // and that the left-child range is "lesser" than this node's range.
  +                Debug.Assert (
  +                    height > leftChildHeight &&
  +                    height - leftChildHeight <= 2u,
  +                    sprintf "Node Height = %i, Left-Child Height = %i" height leftChildHeight)
  +                Debug.Assert (
  +                    measurer.Previous rangeXY.MinValue > leftChildRange.MaxValue,
  +                    sprintf "pred(Node.MinValue) = %O, Left-Child MaxValue = %O" (measurer.Previous rangeXY.MinValue) leftChildRange.MaxValue)
  +                ensureCorrectlyFormed left
  +
  +            | Node (rangeXY : Range<_>, Empty,
  +                    (Node (rightChildRange : Range<_>,_,_, rightChildHeight) as right), height) ->
  +                // Make sure the sets aren't overlapping or touching,
  +                // and that the right-child range is "greater" than this node's range.
  +                Debug.Assert (
  +                    height > rightChildHeight &&
  +                    height - rightChildHeight <= 2u,
  +                    sprintf "Node Height = %i, Right-Child Height = %i" height rightChildHeight)
  +                Debug.Assert (
  +                    measurer.Next rangeXY.MaxValue < rightChildRange.MinValue,
  +                    sprintf "succ(Node.MaxValue) = %O, Right-Child MinValue = %O" (measurer.Next rangeXY.MaxValue) rightChildRange.MinValue)
  +                ensureCorrectlyFormed right
  +
  +            | Node (rangeXY : Range<_>,
  +                    (Node (leftChildRange : Range<_>,_,_,leftChildHeight) as left),
  +                    (Node (rightChildRange : Range<_>,_,_,rightChildHeight) as right), height) ->
  +                // Make sure the sets aren't overlapping or touching,
  +                // and that the left-child range is "lesser" than this node's range.
  +                Debug.Assert (
  +                    height > leftChildHeight &&
  +                    height - leftChildHeight <= 2u,
  +                    sprintf "Node Height = %i, Left-Child Height = %i" height leftChildHeight)
  +                Debug.Assert (
  +                    measurer.Previous rangeXY.MinValue > leftChildRange.MaxValue,
  +                    sprintf "pred(Node.MinValue) = %O, Left-Child MaxValue = %O" (measurer.Previous rangeXY.MinValue) leftChildRange.MaxValue)
  +                ensureCorrectlyFormed left
  +                // Make sure the sets aren't overlapping or touching,
  +                // and that the right-child range is "greater" than this node's range.
  +                Debug.Assert (
  +                    height > rightChildHeight &&
  +                    height - rightChildHeight <= 2u,
  +                    sprintf "Node Height = %i, Right-Child Height = %i" height rightChildHeight)
  +                Debug.Assert (
  +                    measurer.Next rangeXY.MaxValue < rightChildRange.MinValue,
  +                    sprintf "succ(Node.MaxValue) = %O, Right-Child MinValue = %O" (measurer.Next rangeXY.MaxValue) rightChildRange.MinValue)
  +                ensureCorrectlyFormed right
  +
  +        ensureCorrectlyFormed tree
  +        tree
  +
  +    let internal ensureCorrectlyFormed1stAnd3rd measurer (x : Diet<'T>, y, z : Diet<'T>) =
  +        let x' = ensureCorrectlyFormed measurer x
  +        let z' = ensureCorrectlyFormed measurer z
  +        x', y, z'
  +
  +    let internal ensureCorrectlyFormed2Of2 measurer (x, tree : Diet<'T>) =
  +        x, ensureCorrectlyFormed measurer tree
  +
       //
       let rec private find_del_left_rec (measurer : IMeasurer<_>) p (tree : Diet<'T>) cont =
           match tree with
  
positive.code:             AvlTree.singleton rangePQ
          | AvlTree.Node (rangeXY, left, right, _) ->
              if compare rangePQ.MaxValue (measurer.Previous rangeXY.MinValue) < 0 then
                  AvlTree.join rangeXY (addRange measurer rangePQ left) right
              elif compare rangePQ.MinValue (measurer.Next rangeXY.MaxValue) > 0 then
                  AvlTree.join rangeXY left (addRange measurer rangePQ right)
              else
                  let x', left' =
                      if compare rangePQ.MinValue rangeXY.MinValue >= 0 then
                          rangeXY.MinValue, left
                      else find_del_left measurer rangePQ.MinValue left
  
                  let y', right' =
                      if compare rangePQ.MaxValue rangeXY.MaxValue <= 0 then
                          rangeXY.MaxValue, right
                      else find_del_right measurer rangePQ.MaxValue right
  
                  let rangeXY' = Range (x', y')
                  AvlTree.join rangeXY' left' right'
  
      /// Returns a new set with the given element removed.
      /// No exception is thrown if the set doesn't contain the specified element.
  
negative.code:         elements.ToArray ()
  
      //
      let toSet (measurer : IMeasurer<_>) (tree : Diet<'T>) =
          (measurer, Set.empty, tree)
          |||> fold (fun set el ->
              Set.add el set)
  
      // TEMP
      let internal ensureAllElementsUnique (measurer : IMeasurer<_>) (tree : Diet<'T>) =
          let uniqueElementCount =
              toSet measurer tree
              |> Set.count
  
          let actualElementCount = count measurer tree
          Debug.Assert (
              (actualElementCount = uniqueElementCount),
              sprintf "Incorrectly-formed DIET found: contains %i elements, but only %i unique elements." actualElementCount uniqueElementCount)
          tree
  
      //
      let forall (predicate : 'T -> bool) (measurer : IMeasurer<_>) (t : Diet<'T>) =
          // OPTIMIZE : Rewrite this to short-circuit and return early
          // if we find a non-matching element.
  