let all (ds: 'a Deferred.t list) : 'a list Deferred.t = List.fold_left (ds) ~init:(return []) ~f:(fun a d -> a >>= fun a -> d >>= fun x -> return (x::a) ) >>| List.rev