anchor.diff:              for i = 0 to len - 1 do
                   action.Invoke (i, substring.[i])
   
  -    //
  +    /// Applies the given function to each character in the substring,
  +    /// in order from highest to lowest indices.
       [<CompiledName("IterBack")>]
       let iterBack action (substring : substring) : unit =
           let len = substring.Length
           for i = len - 1 downto 0 do
               action substring.[i]
   
  -    //
  +    /// Applies a function to each character of the substring, threading an accumulator
  +    /// argument through the computation.
  +    /// If the input function is f and the characters are c0...cN then computes f (...(f s c0)...) cN.
       [<CompiledName("Fold")>]
       let fold (folder : 'State -> char -> 'State) state (substring : substring) : 'State =
           // OPTIMIZATION : Immediately return if the substring is empty.
  
positive.code:                 state <- folder.Invoke (state, substring.[i])
              state
  
      //
      [<CompiledName("FoldIndexed")>]
      let foldi (folder : 'State -> int -> char -> 'State) state (substring : substring) : 'State =
          // OPTIMIZATION : Immediately return if the substring is empty.
  
negative.code: /// Represents a segment of a string.
  type substring = Substring
  
  /// Functional operators related to Substrings.
  [<RequireQualifiedAccess; CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
  module Substring =
      open OptimizedClosures
  
      /// Returns the string underlying the given substring.
      [<CompiledName("String")>]
      let inline string (substring : substring) : string =
          substring.String
  
      /// The starting offset of the substring within it's underlying string.
      [<CompiledName("Offset")>]
      let inline offset (substring : substring) : int =
          substring.Offset
  
      /// Returns the length of the substring.
      [<CompiledName("Length")>]
      let inline length (substring : substring) : int =
          substring.Length
  
      /// Gets a character from the substring.
      [<CompiledName("Get")>]
      let inline get (substring : substring) index =
          substring.[index]
  
      /// Is the substring empty?
      [<CompiledName("IsEmpty")>]
      let inline isEmpty (substring : substring) : bool =
          substring.IsEmpty
  
      /// Instantiates the substring as a string.
      [<CompiledName("ToString")>]
      let inline toString (substring : substring) : string =
          substring.ToString ()
  
      /// Returns the characters in the given substring as a Unicode character array. 
      [<CompiledName("ToArray")>]
      let inline toArray (substring : substring) : char[] =
          substring.ToArray ()
  
      /// Gets a substring of a substring.
      [<CompiledName("Sub")>]
      let sub (substring : substring) offset count : substring =
          // Preconditions
          if offset < 0 then
              argOutOfRange "offset" "The offset cannot be negative."
          elif count < 0 then
              argOutOfRange "count" "The length of the substring cannot be negative."
          elif offset >= substring.Length then
              argOutOfRange "offset" "The offset must be less than the length of the input substring."
          elif (offset + count) >= substring.Length then
              argOutOfRange "count" "There are fewer than 'count' elements in the \
                                     input substring when starting at the given offset."
  
          // Create a new substring based on the input substring.
          Substring (substring.String, substring.Offset + offset, count)
  
      /// Applies the given function to each character in the substring,
      /// in order from lowest to highest indices.
      [<CompiledName("Iter")>]
      let iter action (substring : substring) : unit =
          let len = substring.Length
          for i = 0 to len - 1 do
              action substring.[i]
  
      /// Applies the given function to each character in the substring,
      /// in order from lowest to highest indices.
      /// The integer index applied to the function is the character's index within the substring.
      [<CompiledName("IterIndexed")>]
      let iteri action (substring : substring) : unit =
          // OPTIMIZATION : Immediately return if the substring is empty.
  