anchor.diff:  
   //
   [<Struct>]
  +[<DebuggerDisplay("Min = {MinValue}, Max = {MaxValue}")>]
  +[<StructuredFormatDisplay("[{MinValue}, {MaxValue}]")>]
   type private Range<'T when 'T : comparison> =
       //
       val MinValue : 'T
  
positive.code: 
          /// Reroot of balanced trees.
          let reroot (comparer : IComparer<_>) l (r : AvlTree<'T>) =
              match r with
              | Empty ->
                  Empty
              | _ ->
                  if AvlTree.height l > AvlTree.height r then
                      let i, l' = AvlTree.extractMax comparer l
                      join i l' r
                  else
                      let i, r' = AvlTree.extractMin comparer r
                      join i l r'
  
negative.code:                 None,
                  AvlTree.Empty
              | Some (rangeXY : Range<_>) ->
                  if compare rangeXY.MaxValue rangeAB.MinValue < 0 then
                      // [x, y] and [a, b] are disjoint
                      let head, stream = AvlTree.tryExtractMin measurer stream
                      diff_helper rangeAB right left head stream
                  elif compare rangeAB.MaxValue rangeXY.MinValue < 0 then
                      // [a, b] and [x, y] are disjoint
                      let (right, head, stream) = diff' right head stream
                      (AvlTree.join rangeAB left right, head, stream)
                  elif compare rangeAB.MinValue rangeXY.MinValue < 0 then
                      // [a, b] and [x, y] overlap
                      // a < x
                      let rangeXB = Range (rangeXY.MinValue, rangeAB.MaxValue)
                      let newRange = Range (rangeAB.MinValue, measurer.Previous rangeXY.MinValue)
                      let newLeft = addRange measurer newRange left
                      diff_helper rangeXB right newLeft head stream
                  elif compare rangeXY.MaxValue rangeAB.MaxValue < 0 then
                      // [a, b] and [x, y] overlap
                      // y < b
                      let (head, stream) = AvlTree.tryExtractMin measurer stream
                      let newRange = Range (measurer.Next rangeXY.MaxValue, rangeAB.MaxValue)
                      diff_helper newRange right left head stream
                  else
                      // [a, b] and [x, y] overlap
                      let (right, head, stream) = diff' right head stream
                      (AvlTree.reroot measurer left right, head, stream)
          
          if AvlTree.isEmpty stream then
              input
  