 
   return first
 }
+
+/// Return the first of an array of `Deferred`s to become determined.
+/// Note that if the array is empty the resulting `Deferred` will resolve to a
+/// `DeferredError.canceled` error.
+/// Note also that if more than one element is already determined at the time
+/// the function is called, the earliest one will be considered first.
+///
+/// - parameter qos: the QoS class at which to execute the new `Deferred`'s notifications
+/// - parameter deferreds: a `Sequence` of `Deferred`
+/// - parameter cancelOthers: whether to attempt to cancel every `Deferred` that doesn't get determined first (defaults to `false`)
+/// - returns: a new `Deferred`
 
 public func firstDetermined<Value, S: Sequence>(qos: DispatchQoS = DispatchQoS.current ?? .default,
                                                 _ deferreds: S, cancelOthers: Bool = false) -> Deferred<Deferred<Value>>

///
/// If any of the elements resolves to an error, the resulting `Deferred` will contain that error.
/// If the reducing function throws an error, the resulting `Deferred` will contain that error.
/// The combined `Deferred` will use the qos from the first element of the input array (unless the input array is empty.)
///
/// - parameter qos: the Quality-of-Service at which the `reduce` operation and its notifications should occur; defaults to the current QoS
/// - parameter deferreds: an array of `Deferred`
/// - parameter combine: a reducing function
/// - returns: a new `Deferred`

public func reduce<T, U>(qos: DispatchQoS = DispatchQoS.current ?? .default, _ deferreds: [Deferred<T>],
                         initial: U, combine: @escaping (U,T) throws -> U) -> Deferred<U>
{
  guard deferreds.isEmpty == false
    else { return Deferred(qos: qos, value: initial) }

  var combined = [Value]()

  let reduced = reduce(qos: qos, deferreds, initial: (), combine: { _, value in combined.append(value) })
  return reduced.map(transform: { _ in combined })
}

/// Returns the result of repeatedly calling `combine` with an
