   /// - parameter reason: a `String` detailing the reason for the attempted cancellation. Defaults to an empty `String`.
   /// - returns: whether the cancellation was performed successfully.
 
-  @discardableResult
-  public final func cancel(_ reason: String = "") -> Bool
-  {
-    return cancel(.canceled(reason))
+  public func cancel(_ reason: String = "")
+  {
+    cancel(.canceled(reason))
+  }
+}
+
+extension Deferred where Failure == Error
+{
+  /// Attempt to cancel this `Deferred`
+  ///
+  /// This method can only succeed if a `Cancellation` can be cast as a `Failure`.
+  ///
+  /// - parameter error: a `DeferredError` detailing the reason for the attempted cancellation.
+  /// - returns: whether the cancellation was performed successfully.
+
+  public func cancel(_ error: Cancellation)
+  {
+    if attemptCancellation() { resolve(.failure(error)) }
+  }
+
+  /// Attempt to cancel this `Deferred`
+  ///
+  /// A successful cancellation will result in a `Deferred` equivalent to as if it had been initialized as follows:
+  /// ```
+  /// Deferred<Success>(error: DeferredError.canceled(reason))
+  /// ```
+  ///
+  /// - parameter reason: a `String` detailing the reason for the attempted cancellation. Defaults to an empty `String`.
+  /// - returns: whether the cancellation was performed successfully.
+
+  public func cancel(_ reason: String = "")
+  {
+    cancel(.canceled(reason))
   }
 }
 

      {
        resolved.deinitialize(count: 1)
        resolved.deallocate()
        return false
      }
      // The atomic compare-and-swap operation uses memory order `.acqrel`.
      // "release" ordering ensures visibility of changes to `resolvedPointer(from:)` above to another thread.

    resolve(.failure(error))
  }

  /// Change the state of the underlying `Deferred` from `.waiting` to `.executing`

  public func beginExecution()
  {
    deferred?.beginExecution()
  }

  /// Query the Quality-of-Service used by this `Resolver`'s underlying `Deferred`

  public var qos: DispatchQoS { return deferred?.queue.qos ?? .unspecified }

  /// Query whether the underlying `Deferred` still exists and is also unresolved

  public var needsResolution: Bool {
    let state = deferred?.state
    return state != nil && state != .resolved
  }

  /// Enqueue a notification to be performed asynchronously after our `Deferred` becomes resolved.
  ///
  /// - parameter queue: the `DispatchQueue` on which to dispatch this notification when ready; defaults to `self`'s queue.
  /// - parameter task: a closure to be executed as a notification
  /// - parameter result: the `Result` to which our `Deferred` was resolved

  public func notify(handler: @escaping () -> Void)
  {
    deferred?.notify(handler: { _ in handler() })
  }

  /// Keep a strong reference to `source` until this `Deferred` has been resolved.
  ///
  /// The implication here is that `source` is needed as an input to `self`.
  ///
  /// - parameter source: a reference to keep alive until this `Deferred` is resolved.

  public func retainSource(_ source: AnyObject)
  {
    deferred?.retainSource(source)
  }
}

// FIXME: Should be a single conditional extension
// Unfortunately, it should be `where Cancellation is Failure`,
// which is not (yet) a valid condition.

extension Resolver where Failure == Cancellation
{
  /// Attempt to cancel the underlying `Deferred`, and report on whether cancellation happened successfully.
  ///
  /// A successful cancellation will result in a `Deferred` equivalent to as if it had been initialized as follows:
