     }(ec)
 }
 
+/**
+
+    Reduces the elements of sequence of deferreds using the specified reducing function `combine`
+
+    :param: dxs Sequence of Deferred
+    :param: initial Initial value that will be passed as first argument in `combine` function
+    :param: combine reducing function
+    :param: ec Execution context of `combine`
+
+    :returns: Deferred which will contain result of reducing sequence of deferreds
+
+*/
 public func reduce<S: SequenceType, T where S.Generator.Element: DeferredType>(dxs: S, initial: T, combine: (T, S.Generator.Element.Element) -> T)(_ ec: ExecutionContextType) -> Deferred<T> {
     return reduce(dxs, Deferred(initial)) { acc, defValue in
         flatMap(defValue) { value in

    return p.deferred
}

public func filter<D: DeferredType>(dx: D, p: D.Element -> Bool)(_ ec: ExecutionContextType) -> Deferred<D.Element?> {
    return map(dx) { x in p(x) ? x : nil }(ec)
}

public func zip<DA: DeferredType, DB: DeferredType>(da: DA, db: DB) -> Deferred<(DA.Element, DB.Element)> {
    
    let ec = ExecutionContext.DefaultPureOperationContext


import typealias Foundation.NSTimeInterval

/**

    Applies the side-effecting function to the result of this deferred,
    and returns a new deferred with the result of this deferred

    :param: dx Deferred
    :param: f side-effecting function that will be applied to result of `dx`
    :param: ec execution context of `f` function

    :returns: a new Deferred

*/
public func andThen<D: DeferredType>(dx: D, f: D.Element -> Void)(_ ec: ExecutionContextType) -> Deferred<D.Element> {
    let p = PurePromise<D.Element>()
    dx.onComplete(ec) { value in
