anchor.diff:      let tryFind k (RangeMap arr) =
           let idx =
               // .NET's binary search function returns special integer values depending on the outcome.
  -            match Array.BinarySearch(arr, Singleton (k, Unchecked.defaultof<_>)) with
  +            match Array.BinarySearch(arr, (k, k, Unchecked.defaultof<_>), secondComparer) with
               // If it is positive, then an exact element was found in the array.
               | x when x >= 0 -> x
               // If it is the bitwise complement of the array's length, the requested element
  
positive.code:     let internal consistencyCheck arr =
          let rec impl k0 =
              function
              | RMCons(RangeInclusive(k1, k2, _), xs) when k0 < k1 && k1 < k2 -> impl k2 xs
              | RMCons(Singleton(k, _), xs) when k0 < k -> impl k xs
              | RMNil -> Some <| RangeMap arr
              | _ -> None
          Array.sortInPlace arr
          match ReadOnlyMemory arr with
          | RMCons(RangeInclusive(k1, k2, _), xs) when k1 < k2 -> impl k2 xs
          | RMCons(RangeInclusive(_), _) -> None
          | RMCons(Singleton(k, _), xs) -> impl k xs
          | RMNil -> Some <| RangeMap arr
  
      /// Creates a `RangeMap` from an array of a range of keys and their corresponding value.
  
negative.code:         let mapKeys (keys, value) =
              keys
              |> Array.map (fun (x1, x2) ->
                  if smallerOrEqual x1 x2 then
                      (x1, x2, value)
                  else
                      (x2, x1, value)
              )
          Array.collect mapKeys pairs |> consistencyCheck
  