You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
-20Lines changed: 0 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -137,23 +137,3 @@ Note that with nested patching, the deepest operations are resolved first: in th
137
137
# Patchouli is a generic patching engine
138
138
139
139
PatchouliJSON depends on [Patchouli Core](https://github.com/alexhunsley/patchouli-core), a generic patching engine. You can use Pathcouli Core to make patchers for other kinds of data.
140
-
141
-
Patchouli Core contains a toy string patcher for demonstration purposes:
142
-
143
-
```
144
-
// Input: "Hello World"
145
-
// Patched result: "Goodbye my friend"
146
-
147
-
let stringPatchContent: StringPatchContent = Content("Hello World") {
148
-
Patch(address: "Hello", with: "Goodbye")
149
-
Patch(address: "World", with: "my friend")
150
-
}
151
-
152
-
let result: String = try stringPatchContent.reduce()
153
-
```
154
-
155
-
# How Patchouli Core works
156
-
157
-
It has two major parts: a DSL that feels similar to SwiftUI, for constructing the patch, and a tree reducer which then performs the patching using appropriate functions.
158
-
159
-
The representation of patchable data and the DSL are both generic, which means that you can write a patcher for anything you like.
0 commit comments