         }
     }
     
+    /**
+
+        Register a callback which will be called when Future is completed with error
+
+        :param: ec execution context of callback
+        :param: c callback
+
+        :returns: Returns itself for chaining operations
+        
+    */
     public func onError(ec: ExecutionContextType, _ c: ErrorCallback) -> Future {
         return onComplete(ec) {
             switch $0 {

}

// MARK:- Future

public final class Future<T, E>: FutureType {
    

    }
    
    // MARK:- Class methods

    /**
    
        Returns a new immediately completed `Future<T, E>` with given `value`

        :param: value value which Future will have

        :returns: a new Future

    */
    public class func succeed(value: T) -> Future {
        return Future(Result(value))
    }


    /**

        Returns a new immediately completed `Future<T, E>` with given `error`

        :param: error error which Future will have

        :returns: a new Future
        
    */
    public class func failed(error: E) -> Future {
        return Future(Result(error))
    }
    
    // MARK:- FutureType methods

    /// Creates a new Future with given Result<T, E>
    public init(_ x: ResultType) {
        self.deferred = Deferred(x)
    }


    /**

        Register a callback which will be called when Future is completed

        :param: ec execution context of callback
        :param: c callback

        :returns: Returns itself for chaining operations
        
    */
    public func onComplete(ec: ExecutionContextType, _ c: CompleteCallback) -> Future {
        deferred.onComplete(ec, c)
        return self
    }


    /**

        Register a callback which will be called when Future is completed with value

        :param: ec execution context of callback
        :param: c callback

        :returns: Returns itself for chaining operations
        
    */
    public func onSuccess(ec: ExecutionContextType, _ c: SuccessCallback) -> Future {
        return onComplete(ec) {
            switch $0 {
