def transform(success, failure)
      promise = Promise.new(@options)
      on_complete_match do |m|
        m.success { |value| promise.success(success.call(value)) }
        m.failure { |error| promise.failure(failure.call(error)) }
      end
      promise.to_future
    end
def transform(success, failure)
      promise = Promise.new(@options)
      on_complete_match do |m|
        m.success { |value| promise.success(success.call(value)) }
        m.failure { |error| promise.failure(failure.call(error)) }
      end
      promise.to_future
    end
Creates a new future by applying the +success+ function to the successful
 result of this future, or the +failure+ function to the failed result.
 If there is any non-fatal error raised when +success+ or +failure+ is
 applied, that error will be propagated to the resulting future.

 @yieldparam success [#get] function that transforms a successful result of the
   receiver into a successful result of the returned future
 @yieldparam failure [#exception] function that transforms a failure of the
   receiver into a failure of the returned future
 @return [Fear::Future] a future that will be completed with the
   transformed value

 @example
   Fear.future { open('http://example.com').read }
     .transform(
        ->(value) { ... },
        ->(error) { ... },
     )