<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Combine",
  "identifier" : "/documentation/Combine/Publishers/Merge",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Combine"
    ],
    "preciseIdentifier" : "s:7Combine10PublishersO5MergeV"
  },
  "title" : "Publishers.Merge"
}
-->

# Publishers.Merge

A publisher created by applying the merge function to two upstream publishers.

```
struct Merge<A, B> where A : Publisher, B : Publisher, A.Failure == B.Failure, A.Output == B.Output
```

## Topics

### Creating a merge publisher

[`init(_:_:)`](/documentation/Combine/Publishers/Merge/init(_:_:))

Creates a publisher created by applying the merge function to two upstream publishers.

### Merging elements

[`merge(with:)`](/documentation/Combine/Publishers/Merge/merge(with:))

[`merge(with:_:)`](/documentation/Combine/Publishers/Merge/merge(with:_:))

[`merge(with:_:_:)`](/documentation/Combine/Publishers/Merge/merge(with:_:_:))

[`merge(with:_:_:_:)`](/documentation/Combine/Publishers/Merge/merge(with:_:_:_:))

[`merge(with:_:_:_:_:)`](/documentation/Combine/Publishers/Merge/merge(with:_:_:_:_:))

[`merge(with:_:_:_:_:_:)`](/documentation/Combine/Publishers/Merge/merge(with:_:_:_:_:_:))

### Declaring supporting types

[`Publishers.Merge.Output`](/documentation/Combine/Publishers/Merge/Output)

The kind of values published by this publisher.

[`Publishers.Merge.Failure`](/documentation/Combine/Publishers/Merge/Failure)

The kind of errors this publisher might publish.

### Inspecting publisher properties

[`a`](/documentation/Combine/Publishers/Merge/a)

A publisher to merge.

[`b`](/documentation/Combine/Publishers/Merge/b)

A second publisher to merge.

### Comparing publishers

[`==(_:_:)`](/documentation/Combine/Publishers/Merge/==(_:_:))

Returns a Boolean value that indicates whether two publishers are equivalent.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)