anchor.diff:          | Node (left, right, (x, y), h) ->
               let czx = compare value x
               if czx < 0 then
  +                // value < x, so recurse down the left subtree.
                   AvlTree.Join comparer (x, y) (remove value left) right
               else
                   let cyz = compare y value
                   if cyz < 0 then
  +                    // y < value, so recurse down the right subtree.
                       AvlTree.Join comparer (x, y) left (remove value right)
                   elif cyz = 0 then
                       if czx = 0 then
  
positive.code:                 let head, stream = AvlTree.TryExtractMin stream
                  union_helper left (min a x, b) right limit head stream
  
              elif greater_limit y then
                  left, Some (min a x, y), stream
  
              else
  
negative.code:                 else
                      addRange (succ value, y) (Node (left, right, (x, pred value), h))
  
      /// Determines if a value is greater than or equal to a given
      /// limit value if one is specified.
      let greater_limit limit value =
          match limit with
          | None -> false
          | Some limit ->
              value >= limit
  
      /// Helper function for computing the union of two sets.
      let rec private union' (input : CharDiet) limit head (stream : CharDiet)
          : CharDiet * (char * char) option * CharDiet =
          match head, input with
          | None, _ ->
              input, None, Empty
          | _, Empty ->
              Empty, head, stream
          | Some (x, y), Node (left, right, (a, b), _) ->
              let left', head, stream =
                  if x < a then
                      union' left (Some <| pred a) head stream
                  else
                      left, head, stream
              union_helper left' (a, b) right limit head stream
  
      /// Helper function for computing the union of two sets.
      and private union_helper left (a, b) (right : CharDiet) limit head stream =
  