anchor.diff:                                  // two states to get the new state value.
                                   Some <| reduction.Invoke (existingState, result))
               )
  +#if DEBUG
  +        |> tap checkParallelLoopResult
  +#endif
           |> ignore
   
           // Since we know the input array isn't empty, a state value _must_ have been set.
  
positive.code:                                 // two states to get the new state value.
                                  Some (mapReduction.Reduce existingState result))
              )
          |> ignore
  
          // Since we know the input array isn't empty, a state value _must_ have been set.
  
negative.code:         combineWorkerResults workerResults1,
          combineWorkerResults workerResults2
  
      /// <summary>Returns the greatest of all elements of the array, compared via Operators.max on the function result.</summary>
      /// <param name="array">The input array.</param>
      /// <returns>The maximum element.</returns>
      /// <exception cref="System.ArgumentException">Thrown when the input array is empty.</exception>
      [<CompiledName("Max")>]
      let max (array : 'T[]) : 'T =
          // Preconditions
          checkNonNull "array" array
          if Array.isEmpty array then
              invalidArg "array" "The array is empty."
  
          // Reduce using the 'max' operator.
          reduce max array
  
      /// <summary>Returns the greatest of all elements of the array, compared via Operators.max on the function result.</summary>
      /// <param name="projection">The function to transform the elements into a type supporting comparison.</param>
      /// <param name="array">The input array.</param>
      /// <returns>The maximum element.</returns>
      /// <exception cref="System.ArgumentException">Thrown when the input array is empty.</exception>
      [<CompiledName("MaxBy")>]
      let maxBy (projection : 'T -> 'U) (array : 'T[]) : 'T =
          // Preconditions
          checkNonNull "array" array
          if Array.isEmpty array then
              invalidArg "array" "The array is empty."
  
          // Reduce using the 'maxBy' operator with the projection function.
          reduce (maxBy projection) array
  
      /// <summary>Returns the least of all elements of the array, compared via Operators.min on the function result.</summary>
      /// <param name="array">The input array.</param>
      /// <returns>The minimum element.</returns>
      /// <exception cref="System.ArgumentException">Thrown when the input array is empty.</exception>
      [<CompiledName("Min")>]
      let min (array : 'T[]) : 'T =
          // Preconditions
          checkNonNull "array" array
          if Array.isEmpty array then
              invalidArg "array" "The array is empty."
  
          // Reduce using the 'min' operator.
          reduce min array
  
      /// <summary>Returns the least of all elements of the array, compared via Operators.min on the function result.</summary>
      /// <param name="projection">The function to transform the elements into a type supporting comparison.</param>
      /// <param name="array">The input array.</param>
      /// <returns>The minimum element.</returns>
      /// <exception cref="System.ArgumentException">Thrown when the input array is empty.</exception>
      [<CompiledName("MinBy")>]
      let minBy (projection : 'T -> 'U) (array : 'T[]) : 'T =
          // Preconditions
          checkNonNull "array" array
          if Array.isEmpty array then
              invalidArg "array" "The array is empty."
  
          // Reduce using the 'minBy' operator with the projection function.
          reduce (minBy projection) array
  
      /// <summary>Returns the sum of the elements in the array.</summary>
      /// <param name="array">The input array.</param>
      /// <returns>The resulting sum.</returns>
      [<CompiledName("Sum")>]
      let inline sum (array: (^T)[] ) : ^T = 
          // Preconditions
          checkNonNull "array" array
  
          // If the array is empty, immediately return zero.
          if Array.isEmpty array then
              LanguagePrimitives.GenericZero<_>
          else
              // Reduce the array using checked addition, just like Array.sum.
              reduce (Checked.(+)) array
  
      /// <summary>Returns the sum of the results generated by applying the function to each element of the array.</summary>
      /// <param name="projection">The function to transform the array elements into the type to be summed.</param>
      /// <param name="array">The input array.</param>
      /// <returns>The resulting sum.</returns>
      [<CompiledName("SumBy")>]
      let inline sumBy (projection : 'T -> ^U) (array: (^T)[] ) : ^U =
          // Preconditions
          checkNonNull "array" array
  
          // If the array is empty, immediately return zero.
          if Array.isEmpty array then
              LanguagePrimitives.GenericZero<_>
          else
              // Reduce the array using checked addition, just like Array.sumBy.
              array
              |> mapReduce
                  { new IMapReduction<_,_> with
                      member __.Map x =
                          projection x
                      member __.Reduce x y =
                          Checked.(+) x y }
  
  #endif  // #if !FX_NO_TPL_PARALLEL
  