anchor.diff:              result
   
       /// Comparison function for DIETs.
  -    let rec compare (measurer : IMeasurer<_>) (t1 : Diet<'T>) (t2 : Diet<'T>) =
  +    let rec comparison (t1 : CharDiet) (t2 : CharDiet) =
           match t1, t2 with
           | Node (_,_,_,_), Node (_,_,_,_) ->
  -            let i1, r1 = AvlTree.extractMin measurer t1
  -            let i2, r2 = AvlTree.extractMin measurer t2
  +            let (ix1, iy1), r1 = AvlTree.extractMin charComparer t1
  +            let (ix2, iy2), r2 = AvlTree.extractMin charComparer t2
               let c =
  -                let d = measurer.Compare (i1.MinValue, i2.MinValue)
  +                let d = compare ix1 ix2
                   if d <> 0 then -d
  -                else measurer.Compare (i1.MaxValue, i2.MaxValue)
  -
  +                else compare iy1 iy2
               if c <> 0 then c
  -            else compare measurer r1 r2
  +            else comparison r1 r2
           
           | Node (_,_,_,_), Empty -> 1
           | Empty, Empty -> 0
           | Empty, Node (_,_,_,_) -> -1
   
       /// Equality function for DIETs.
  -    let equal (measurer : IMeasurer<_>) (t1 : Diet<'T>) (t2 : Diet<'T>) =
  -        compare measurer t1 t2 = 0
  -
  -    //
  -    let rec split (measurer : IMeasurer<_>) x (tree : Diet<'T>) =
  -        let inline compare a b =
  -            measurer.Compare (a, b)
  -
  +    let equal (t1 : CharDiet) (t2 : CharDiet) =
  +        comparison t1 t2 = 0
  +
  +    //
  +    let rec split x (tree : CharDiet) =
           match tree with
           | AvlTree.Empty ->
               AvlTree.Empty, false, AvlTree.Empty
  -        | AvlTree.Node (rangeAB : Range<_>, l, r, _) ->
  -            let cxa = compare x rangeAB.MinValue
  +        | AvlTree.Node ((a, b), l, r, _) ->
  +            let cxa = compare x a
               if cxa < 0 then
  -                let ll, pres, rl = split measurer x l
  -                ll, pres, AvlTree.join rangeAB rl r
  +                let ll, pres, rl = split x l
  +                ll, pres, AvlDiet.join (a, b) rl r
               else
  -                let cbx = compare rangeAB.MaxValue x
  +                let cbx = compare b x
                   if cbx < 0 then
  -                    let lr, pres, rr = split measurer x r
  -                    AvlTree.join rangeAB l lr, pres, rr
  +                    let lr, pres, rr = split x r
  +                    AvlDiet.join (a, b) l lr, pres, rr
                   else
  -                    ((if cxa = 0 then l else addRange measurer (Range (rangeAB.MinValue, measurer.Previous x)) l),
  -                       true,
  -                       (if cbx = 0 then r else addRange measurer (Range (measurer.Next x, rangeAB.MaxValue)) r))
  +                    (if cxa = 0 then l else addRange (a, pred x) l),
  +                    true,
  +                    (if cbx = 0 then r else addRange (succ x, b) r)
   
   
   /// Character set implementation based on a Discrete Interval Encoding Tree.
   /// This is faster and more efficient than the built-in F# Set<'T>,
   /// especially for dense sets.
   [<DebuggerDisplay("Count = {Count}, Intervals = {IntervalCount}")>]
  -type CharSet private (dietSet : Diet<char>) =
  +type CharSet private (dietSet : CharDiet) =
       //
       static let empty = CharSet (Diet.empty)
   
       //
       static let charComparer =
           LanguagePrimitives.FastGenericComparer<char>
  -
  -    //
  -    static let charMeasurer = {
  -        new IMeasurer<char> with
  -            member __.Compare (x, y) =
  -                charComparer.Compare (x, y)
  -            member __.Previous x =
  -                char <| (uint16 x) - 1us
  -            member __.Next x =
  -                char <| (uint16 x) + 1us
  -            member __.Distance (x, y) =
  -                int y - int x }
   
       //
       static member Empty
  
positive.code: 
      //
      static member OfList list =
          CharSet (Diet.ofList charMeasurer list)
  
  //    //
  //    static member ToSet (charSet : CharSet) =
  
negative.code:             #if DEBUG
              /// The minimum possible number of elements in the resulting set.
              let minPossibleResultCount =
                  let inputCount = count input
                  let streamCount = count stream
                  GenericMaximum 0 (inputCount - streamCount)
              #endif
  
              let head, stream' = AvlTree.extractMin charComparer stream
              let result, _, _ = diff' input (Some head) stream'
  
              #if DEBUG
              let resultCount = count result
              Debug.Assert (
                  resultCount >= minPossibleResultCount,
                  sprintf "The result set should not contain fewer than %i elements, but it contains only %i elements."
  