Skip to content

Commit e21ffe2

Browse files
committed
Update README
1 parent a026c2b commit e21ffe2

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# swift-mrdt
22

3-
<badges>
3+
[![CI](https://github.com/structuredpath/swift-mrdt/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/structuredpath/swift-mrdt/actions/workflows/ci.yml) ![Swift 6.0+](https://img.shields.io/badge/Swift-6.0%2B-orange.svg)
44

55
An implementation of [Mergeable Replicated Data Types](https://doi.org/10.1145/3360580) (MRDTs) for Swift collection types, as introduced by Kaki et al. (OOPSLA 2019).
66

@@ -26,7 +26,7 @@ let merged = Set.merge(
2626
left: ["a", "c"], // removed "b", added "c"
2727
right: ["a", "b", "d"] // added "d"
2828
)
29-
// ["a", "c", "d"]
29+
// => ["a", "c", "d"]
3030
```
3131

3232
### Ordered Set
@@ -40,7 +40,7 @@ let merged = OrderedSet.merge(
4040
right: ["a", "b", "d", "c"], // swapped "c" and "d"
4141
options: .init(isOrderedBeforeWhenConflicting: <)
4242
)
43-
// ["b", "a", "d", "c"]
43+
// => ["b", "a", "d", "c"]
4444
```
4545

4646
A deterministic comparator is required to resolve ordering conflicts when the relative order of two elements cannot be determined from the merge inputs alone:
@@ -52,7 +52,7 @@ let merged = OrderedSet.merge(
5252
right: ["a", "b", "y"], // added "y"
5353
options: .init(isOrderedBeforeWhenConflicting: <)
5454
)
55-
// ["a", "b", "x", "y"]
55+
// => ["a", "b", "x", "y"]
5656
```
5757

5858
### Dictionary
@@ -66,7 +66,7 @@ let merged = Dictionary.merge(
6666
right: ["a": 5, "b": 2], // changed "a"
6767
options: .init(mergeValue: { left, right in max(left, right) })
6868
)
69-
// ["a": 5, "b": 2, "c": 4]
69+
// => ["a": 5, "b": 2, "c": 4]
7070
```
7171

7272
For more control, separate closures can be provided for concurrent edits (where the base value is available) and concurrent insertions:
@@ -85,7 +85,7 @@ let merged = Dictionary.merge(
8585
}
8686
)
8787
)
88-
// ["a": 7, "b": 20]
88+
// => ["a": 7, "b": 20]
8989
```
9090

9191
### Ordered Dictionary
@@ -102,7 +102,7 @@ let merged = OrderedDictionary.merge(
102102
mergeValue: { left, right in [left, right].sorted().joined(separator: "|") }
103103
)
104104
)
105-
// [2: "b", 1: "x|y", 3: "c"]
105+
// => [2: "b", 1: "x|y", 3: "c"]
106106
```
107107

108108
## Installation

0 commit comments

Comments
 (0)