@@ -130,12 +130,11 @@ public extension Delta where Element: ~Copyable {
130
130
}
131
131
}
132
132
133
- /// Returns a reduced view of the delta , favoring the given side.
133
+ /// Resolves the delta to a single element , favoring the element on the given side.
134
134
///
135
- /// If an element is available on the favored side, it is returned.
136
- /// Otherwise, the element on the other side is returned.
135
+ /// If the favored element is not available, the other element is returned.
137
136
@inlinable
138
- consuming func unified ( favoring side: Side ) -> Element {
137
+ consuming func resolve ( favoring side: Side ) -> Element {
139
138
switch side {
140
139
case . source:
141
140
switch consume self {
@@ -152,18 +151,18 @@ public extension Delta where Element: ~Copyable {
152
151
}
153
152
}
154
153
155
- /// Returns the combined value of the source and target element, if modified, otherwise returns the source or target value .
154
+ /// Resolves the delta to a single element, coalescing the source and target elements in the transition case .
156
155
@inlinable
157
- consuming func reduce < E> (
158
- combine : ( consuming Element , consuming Element ) throws ( E ) -> Element
156
+ consuming func merge < E> (
157
+ coalesce : ( consuming Element , consuming Element ) throws ( E ) -> Element
159
158
) throws ( E) -> Element {
160
159
switch consume self {
161
160
case . source( let source) :
162
161
source
163
162
case . target( let target) :
164
163
target
165
164
case . transition( let source, let target) :
166
- try combine ( source, target)
165
+ try coalesce ( source, target)
167
166
}
168
167
}
169
168
}
0 commit comments