Rob Rix
b9d96134ea
Merge branch 'master' into side-by-side-diffs
2015-10-13 13:18:05 -04:00
Rob Rix
f1bb19be12
Grey backgrounds for replacements.
2015-10-13 13:17:18 -04:00
Josh Vera
bd4f1e7fc1
Merge pull request #83 from github/recur-into-keyed-terms-with-equal-keys
...
Recur into Keyed terms with equal keys
2015-10-13 13:16:56 -04:00
joshvera
d2d2412260
Merge branch 'master' into recur-into-indexed-terms-of-equal-length
2015-10-13 13:03:13 -04:00
Matt Diephouse
692bb05a4e
Merge pull request #96 from github/generalize-array-extension
...
Generalize array extension
2015-10-13 12:48:20 -04:00
Rob Rix
c0ab5abd9f
Drop the outline from replacements.
2015-10-13 12:44:25 -04:00
Rob Rix
fad02bab81
Give replacements a background colour.
2015-10-13 11:47:07 -04:00
Rob Rix
4ed33b485a
Background colours for insertions/deletions.
2015-10-13 11:43:25 -04:00
Rob Rix
2a671d5403
Change up the outline colours.
2015-10-13 11:43:17 -04:00
Rob Rix
67a19682e8
HIghlight replacements.
2015-10-13 11:25:20 -04:00
Rob Rix
7aab1da72c
Shift things to either side.
2015-10-13 11:24:55 -04:00
Rob Rix
dd05a2d5ee
Skip empty branches.
2015-10-13 11:24:08 -04:00
Rob Rix
91093f1aac
Only wrap elements that exist.
2015-10-13 11:22:56 -04:00
Rob Rix
ec9c29e29d
Only add children that exist.
2015-10-13 11:22:34 -04:00
Rob Rix
b10f4e2507
Don’t float things.
2015-10-13 11:20:54 -04:00
Rob Rix
b5f8516ab7
Leaves are wrapped in paragraphs.
2015-10-13 11:16:52 -04:00
Rob Rix
6a9e71fcd5
Arrays wrap their children in <li> elements.
2015-10-13 11:15:33 -04:00
Rob Rix
69568fb622
Arrays add <ol> elements.
2015-10-13 11:15:23 -04:00
Rob Rix
208238ae6e
Add a function to wrap a node in another node.
2015-10-13 11:10:54 -04:00
Rob Rix
0dcecb9a00
Rename the DOM variable.
2015-10-13 11:09:30 -04:00
Rob Rix
f236cc9a52
Remove the left/right elements.
2015-10-13 11:08:12 -04:00
Rob Rix
90d3bee821
Disallow floating past other elements.
2015-10-13 11:07:55 -04:00
Rob Rix
27b5007eff
Style insertions/deletions a little.
2015-10-13 11:07:40 -04:00
Rob Rix
205449e197
Insert the diffs into a #diff element.
2015-10-13 11:05:13 -04:00
Rob Rix
d653790ee3
Add diffs to the body.
2015-10-13 11:04:21 -04:00
Rob Rix
6050677c3d
Ignore other keys, apparently.
2015-10-13 11:03:37 -04:00
Rob Rix
b8c5789786
Add before/after states.
2015-10-13 11:03:27 -04:00
Rob Rix
5d864a7f3d
Add replacements to the DOM.
2015-10-13 11:01:32 -04:00
Rob Rix
984858bb9c
Careful with your null checks, there.
2015-10-13 11:00:38 -04:00
Rob Rix
82918f0f4b
Add deletions.
2015-10-13 11:00:29 -04:00
Rob Rix
c7cc290f1d
Add insertions.
2015-10-13 10:59:45 -04:00
Rob Rix
549f482ebe
yes, she knows it’s a multipass
2015-10-13 10:57:24 -04:00
Rob Rix
cf64fbb7c7
Prefix categories.
2015-10-13 10:57:07 -04:00
Rob Rix
724e875a8e
Add categories.
2015-10-13 10:57:01 -04:00
Rob Rix
fff6bcf2fe
Add nodes’ text content.
2015-10-13 10:56:34 -04:00
Rob Rix
869322c69b
Tweak the fixture format.
2015-10-13 10:43:31 -04:00
Rob Rix
c5f2832663
Insert elements into the DOM.
2015-10-13 10:25:51 -04:00
Rob Rix
e9e6fe859e
Recur through arrays.
2015-10-13 10:25:35 -04:00
Rob Rix
0f3bc75982
Construct and return a div.
2015-10-13 10:17:17 -04:00
Rob Rix
b3c4daf904
Semicolons.
2015-10-13 10:16:54 -04:00
Rob Rix
80c0443820
Abbreviate the JSON for Info.
2015-10-13 09:49:56 -04:00
Rob Rix
26aabe9c58
Call the faux sum type thing.
2015-10-13 09:47:52 -04:00
Rob Rix
161b0b86e5
Add a function doing faux sum typing on JSON.
2015-10-13 09:47:47 -04:00
Rob Rix
afda174752
Rename the file.
2015-10-13 01:02:05 -04:00
Rob Rix
7fedcb2331
Generalize the Array extension to RangeReplaceableCollectionType.
2015-10-13 01:01:32 -04:00
Rob Rix
a45e286594
🔥 String.swift.
...
Unused.
2015-10-13 00:58:35 -04:00
Rob Rix
c72a5e2e85
Rename Prelude.swift to Optional.swift.
2015-10-13 00:56:27 -04:00
Rob Rix
27126cabf7
Use Prelude’s function composition operator.
2015-10-13 00:56:13 -04:00
Rob Rix
58bdd153cb
I think fix
was just unused.
2015-10-13 00:55:49 -04:00
Rob Rix
4580dfae7f
Use Prelude’s const.
2015-10-13 00:55:30 -04:00
Rob Rix
d32ac4c789
Use Prelude’s id.
2015-10-13 00:55:20 -04:00
Rob Rix
94182aac35
Everything links against the dependencies.
2015-10-13 00:53:54 -04:00
Rob Rix
0691637f66
Bump Stream to fix a runtime deadlock.
2015-10-13 00:52:41 -04:00
Rob Rix
5bf82fd366
🔥 Memo and Stream.
2015-10-13 00:51:43 -04:00
Rob Rix
cc7538bd40
Link against the dependencies.
2015-10-13 00:50:15 -04:00
Rob Rix
c9794d6c08
Add the other dependencies to the workspace.
2015-10-13 00:45:53 -04:00
Rob Rix
b06b241848
Bump Stream.
2015-10-13 00:45:45 -04:00
Rob Rix
2aa47c80b7
Add Stream to the workspace.
2015-10-13 00:43:33 -04:00
Rob Rix
d96c2b1629
Bump Stream.
2015-10-13 00:43:28 -04:00
Rob Rix
bacd52dda7
Include Stream.
2015-10-13 00:20:33 -04:00
Rob Rix
dd0e21866c
Move doubt-swift’s dependencies into its group.
2015-10-13 00:19:56 -04:00
Rob Rix
d2be94c409
🔥 most of the custom operators.
2015-10-13 00:06:15 -04:00
Rob Rix
46df3daa08
🔥 Parse.swift.
2015-10-13 00:05:16 -04:00
Rob Rix
48ce6b7a7f
Recur into Keyed nodes with equal keys.
2015-10-09 20:38:48 -04:00
Rob Rix
83b95a0e5d
Correct the comment.
2015-10-09 20:24:42 -04:00
Rob Rix
d0ee908d54
Recur into indexed terms of equal length.
2015-10-09 20:24:39 -04:00
Rob Rix
962e3fda24
Switch over a/b’s syntaxes.
2015-10-09 20:24:30 -04:00
Rob Rix
9e7b8275b9
Rearrange the decisions in .Recursive evaluation.
2015-10-09 20:22:38 -04:00
Rob Rix
b1cc34bf2b
doubt-json uses the construction conveniences.
2015-10-09 18:09:38 -04:00
Rob Rix
74e3caa9ce
doubt-swift uses the construction conveniences.
2015-10-09 18:09:32 -04:00
Rob Rix
290ff8853c
SESTests uses the constructor conveniences.
2015-10-09 18:09:15 -04:00
Rob Rix
67d861839f
SyntaxConvertible extension methods are public.
2015-10-09 18:07:31 -04:00
Rob Rix
3cf5ce3b43
Construct Fix directly in discardNullTerms
.
2015-10-09 18:05:50 -04:00
Rob Rix
da8d51e9ee
Free is SyntaxConvertible.
2015-10-09 18:04:29 -04:00
Rob Rix
13eff7f9df
Fix is SyntaxConvertible.
2015-10-09 18:03:23 -04:00
Rob Rix
30d594b4a3
SyntaxConvertible types can be constructed with shorthands.
2015-10-09 18:02:25 -04:00
Rob Rix
cdc1fbb99a
Add a protocol for Syntax wrapper construction.
2015-10-09 18:02:11 -04:00
Rob Rix
fed06df766
Replace the JSON with a more compact representation.
2015-10-09 14:31:58 -05:00
Rob Rix
d33703fd00
Flatten the Free representation.
2015-10-09 14:31:10 -05:00
Rob Rix
396624e9e4
Revert "Wrap Fix.JSON in a dictionary."
...
This reverts commit dbb75aa6beace787d411dab7392e75bc37ac14c2.
2015-10-09 14:29:30 -05:00
Rob Rix
f8f055907f
Add left/right divs.
2015-10-09 14:27:44 -05:00
Rob Rix
5a1059832c
Space.
2015-10-09 13:36:38 -05:00
Rob Rix
83e228f1aa
Parse the response text.
2015-10-09 13:36:18 -05:00
Rob Rix
bfffe03d81
Add a simple scaffold web page loading the doubt-swift JSON output fixture.
2015-10-09 13:31:06 -05:00
Rob Rix
8aa31288e5
Add a fixture with JSON output from doubt-swift.
2015-10-09 13:30:40 -05:00
Rob Rix
e2ae3dc533
Print Swift diffs as JSON.
2015-10-09 09:21:42 -05:00
Rob Rix
7c6481ef47
Print JSON diffs as JSON.
2015-10-09 09:20:46 -05:00
Rob Rix
e045a9063f
Serialization of JSON to NSData.
2015-10-09 09:18:05 -05:00
Rob Rix
07279ca344
JSON can be converted back to an object.
2015-10-09 09:17:57 -05:00
Rob Rix
23133fe3e8
JSONLeaf is CustomJSONConvertible.
2015-10-09 09:14:07 -05:00
Rob Rix
56ef476f70
JSONLeaf has a section header for CustomStringConvertible.
2015-10-09 09:13:09 -05:00
Rob Rix
a9dcb801f2
Free has a JSON property when A is CustomJSONConvertible and B is Patch<A>.
2015-10-09 09:11:48 -05:00
Rob Rix
b422f7d9e4
Free has a unary JSON method when A is CustomJSONConvertible.
2015-10-09 09:08:35 -05:00
Rob Rix
86c92e143a
Fix has a JSON property when A is CustomJSONConvertible.
2015-10-09 09:07:00 -05:00
Rob Rix
5fc16e86f8
Patch has a JSON property when A is CustomJSONConvertible.
2015-10-09 09:06:06 -05:00
Rob Rix
4512b6f2e7
Scope the JSON constructor correctly.
2015-10-09 09:02:31 -05:00
Rob Rix
05e1b97c90
I’m very confused as to how this has remained broken.
2015-10-09 09:02:02 -05:00
Rob Rix
bf7838170e
Wrap Fix.JSON in a dictionary.
2015-10-09 08:45:23 -04:00
Rob Rix
bf4abc5eaa
Infer the scope in Syntax.JSON.
2015-10-09 08:44:16 -04:00
Rob Rix
ea29b2846a
Construct Patch.JSON using dictionary literals.
2015-10-09 08:43:57 -04:00
Rob Rix
ce1ef77f49
Construct Info.JSON using dictionary literals.
2015-10-09 08:43:43 -04:00
Rob Rix
ed9dfd2f34
Construct Free.JSON using dictionary literals.
2015-10-09 08:43:32 -04:00
Rob Rix
be8a93363a
Construct Category.JSON using a dictionary literal.
2015-10-09 08:43:22 -04:00
Rob Rix
4b2fea5d13
Change Patch’s JSON heading.
2015-10-09 08:41:08 -04:00
Rob Rix
ef01e25d47
Change Syntax’s JSON heading.
2015-10-09 08:40:57 -04:00
Rob Rix
3e47d529cc
Change Free’s JSON heading.
2015-10-09 08:39:57 -04:00
Rob Rix
02dc992476
Change Fix’s JSON heading.
2015-10-09 08:39:44 -04:00
Rob Rix
0cb6b01c9c
JSON is NilLiteralConvertible.
2015-10-09 08:38:26 -04:00
Rob Rix
669ebed71c
JSON is DictionaryLiteralConvertible.
2015-10-09 08:37:48 -04:00
Rob Rix
82e5c00e6a
JSON is ArrayLiteralConvertible.
2015-10-09 08:36:46 -04:00
Rob Rix
3fac63ddc9
JSON is StringLiteralConvertible.
2015-10-09 08:35:47 -04:00
Rob Rix
c6b233b2bb
JSON is BooleanLiteralConvertible.
2015-10-09 08:34:54 -04:00
Rob Rix
d0e7e41553
JSON is FloatLiteralConvertible.
2015-10-09 08:34:11 -04:00
Rob Rix
97e0e8accd
JSON is IntegerLiteralConvertible.
2015-10-09 08:33:24 -04:00
Rob Rix
64ad2dc854
Section mark for Category hashing.
2015-10-09 08:31:23 -04:00
Rob Rix
b6f6042e10
Section mark for Category comparisons.
2015-10-09 08:31:10 -04:00
Rob Rix
9e51c130c4
Section mark for Category equality.
2015-10-09 08:31:04 -04:00
Rob Rix
4117b3c710
Info is CustomJSONConvertible.
2015-10-09 08:30:33 -04:00
Rob Rix
327249cb94
Category is CustomJSONConvertible.
2015-10-09 08:30:21 -04:00
Rob Rix
bb8b968994
Add a CustomJSONConvertible protocol.
2015-10-09 08:28:08 -04:00
Rob Rix
e739fcd2a5
Move JSONConvertible into JSON.swift.
2015-10-09 08:27:12 -04:00
Rob Rix
a917331f35
Section mark for Info’s CustomDebugStringConvertible implementation.
2015-10-09 08:25:26 -04:00
Rob Rix
41a3b53542
Section mark for Info’s AlgebraicHashable implementation.
2015-10-09 08:25:16 -04:00
Rob Rix
5b1b358d42
Section header for Info equality.
2015-10-09 08:21:45 -04:00
Rob Rix
341e18e84d
Patch encodes its cases inline.
2015-10-08 07:31:43 -04:00
Rob Rix
0ebed9599b
Free.Roll encodes its case explicitly.
2015-10-08 07:30:34 -04:00
Rob Rix
7dd861169f
Free.Pure encodes its case explicitly.
2015-10-08 07:30:02 -04:00
Rob Rix
5610b9737c
Parametric JSON conversion for Patch.
2015-10-08 07:28:03 -04:00
Rob Rix
d8e8d4d91f
Parametric JSON conversion for Fix.
2015-10-08 07:23:56 -04:00
Rob Rix
22b77ecd76
Parametric JSON conversion for Free.
2015-10-08 07:21:08 -04:00
Rob Rix
44d2804367
Parametric JSON conversion for Syntax.
2015-10-08 07:19:37 -04:00
Rob Rix
f512e665ef
Section header for hashing.
2015-10-08 07:15:52 -04:00
Rob Rix
a3341a71cb
JSON is JSONConvertible.
2015-10-08 07:13:05 -04:00
Rob Rix
04cc6607f3
Add JSONConvertible.
2015-10-08 07:10:13 -04:00
Rob Rix
0f09ea2201
The tests do not depend on SourceKitten.
2015-10-08 07:06:46 -04:00
Rob Rix
488d214503
JSON is Equatable.
2015-10-08 07:06:16 -04:00
Rob Rix
b182f9cd41
Share the doubt-json scheme.
2015-10-07 20:08:56 -04:00
Rob Rix
c2f847ba34
Add fixtures for doubt-json.
2015-10-07 20:08:44 -04:00
Rob Rix
97e8f1725f
JSONLeaf is CustomStringConvertible.
2015-10-07 20:08:34 -04:00
Rob Rix
f1cbb6d642
Compute the diff between two JSON files.
2015-10-07 19:43:22 -04:00
Rob Rix
551fb2b03d
JSONLeaf is Equatable.
2015-10-07 19:43:00 -04:00
Rob Rix
a41c620b0c
Merge branch 'shortest-edit-script-in-algorithm' into diff-json
...
Conflicts:
prototype/Doubt/Algorithm.swift
prototype/Doubt/Category.swift
2015-10-07 19:41:14 -04:00
Rob Rix
c60ce4052c
Compute the term for a given JSON node.
2015-10-07 19:38:24 -04:00
Rob Rix
7953cbed82
Spacing.
2015-10-07 19:36:58 -04:00
Rob Rix
eb62a4e08f
Dictionary.init(elements:) is public.
2015-10-07 19:36:53 -04:00
Rob Rix
16a933af86
Term typealias.
2015-10-07 19:36:43 -04:00
Rob Rix
6efa8249cd
Extension to construct JSON
with a path.
2015-10-07 19:32:02 -04:00
Rob Rix
ea8a4ee360
Link Doubt explicitly.
...
Otherwise dependencies don’t get rebuilt.
2015-10-07 19:27:17 -04:00
Rob Rix
9c98bc187a
BoundsCheckedArray.init is public.
2015-10-07 19:26:35 -04:00
Rob Rix
55a54be79f
Add a JSONLeaf type.
2015-10-07 19:21:26 -04:00
Rob Rix
e26062e107
Stub in a doubt-json target.
2015-10-07 19:20:40 -04:00
Rob Rix
a474ad26c3
Move BoundsCheckedArray into the framework.
2015-10-07 19:18:59 -04:00
Rob Rix
63edfe863f
Empty brackets are empty.
2015-10-07 17:47:45 -04:00
Rob Rix
3787f735fb
Don’t add spaces after separators.
2015-10-07 17:42:43 -04:00
Rob Rix
8d7968eb14
Pretty-print the resulting diff.
2015-10-07 17:37:20 -04:00
Rob Rix
f9de814a35
No need to compute layouts we’re not going to use.
2015-10-07 17:36:59 -04:00
Rob Rix
420dd640b8
joinWithSeparator can introduce newlines.
2015-10-07 17:31:07 -04:00
Rob Rix
15c93699d2
Flattening distributes through nesting.
2015-10-07 17:25:37 -04:00
Rob Rix
b8c17d62c1
Fix a find/replace error.
2015-10-07 17:25:15 -04:00
Rob Rix
3b8b10a4a2
Test that empty docs have empty layout.
2015-10-07 17:22:53 -04:00
Rob Rix
1d8ceac332
Doc is CustomDebugStringConvertible.
2015-10-07 17:20:20 -04:00
Rob Rix
14a2d9bc1c
Patch is CustomDocConvertible.
2015-10-07 17:20:13 -04:00
Rob Rix
2a8e017282
Free is CustomDocConvertible.
2015-10-07 17:20:09 -04:00
Rob Rix
804e831705
🔥 SwiftTests.
...
This was not really testing anything anyway.
2015-10-07 17:20:02 -04:00
Rob Rix
37e204a1e3
Fix is CustomDocConvertible.
...
It simply defers it to Syntax.
2015-10-07 17:19:56 -04:00
Rob Rix
519b8477fd
Diffing by key handles equal terms correctly.
2015-10-07 17:19:50 -04:00
Rob Rix
0ad285fb26
Document the Recursive operation a little.
2015-10-07 13:28:16 -04:00
Rob Rix
06c456f1cd
Document dictionary diffing as an approach stemming from set reconciliation.
2015-10-07 13:25:02 -04:00
Rob Rix
21ac5822a0
Sort categories alphabetically.
2015-10-07 13:20:41 -04:00
Rob Rix
f8b89bd93b
Category is Comparable.
2015-10-07 13:20:22 -04:00
Rob Rix
aef4c32754
Don’t bother destructuring tags.
2015-10-07 13:20:09 -04:00
Rob Rix
ba650f8080
Handle the zero-category case with a where clause.
2015-10-07 13:19:49 -04:00
Rob Rix
4bcc773fc6
🔥 chaff.
2015-10-07 13:13:51 -04:00
Rob Rix
c2b00c2230
Nominate the best interior edge using compare-parametric min.
2015-10-07 13:13:32 -04:00
Rob Rix
47dec5546d
Restore the compare-parametric min
function.
2015-10-07 13:09:22 -04:00
Rob Rix
10ddaab0ed
Use values
instead of mapping.
2015-10-07 13:04:03 -04:00
Rob Rix
ecef6f8370
Rename FreeAlgorithm
to Algorithm
.
2015-10-07 13:00:54 -04:00
Rob Rix
b8b5a26b46
Update doc comments.
2015-10-07 13:00:17 -04:00
Rob Rix
fa7a89c247
Rename Algorithm to Operation.
2015-10-07 12:59:22 -04:00
Rob Rix
1d7286a6a2
Reference the module map in the build settings.
2015-10-07 08:52:32 -04:00
Rob Rix
a8e38b1aa9
Add a module map.
2015-10-07 08:52:26 -04:00
Rob Rix
0b920df272
Diffing by key handles equal terms correctly.
2015-10-07 08:47:37 -04:00
Rob Rix
7852d8a515
Diffs have an inverse.
2015-10-07 08:43:30 -04:00
Rob Rix
0af93b4c68
Patches have an inverse.
2015-10-07 08:41:54 -04:00
Rob Rix
8a9f74a0ff
Use discardNullTerms to compute both states.
2015-10-06 21:39:11 -04:00
Rob Rix
321622d553
Extract the discarding of null terms into a private helper function.
2015-10-06 21:38:44 -04:00
Rob Rix
e1dd859db9
Implicit parameters.
2015-10-06 21:36:22 -04:00
Rob Rix
ee969a75fa
Compute the after state of diffs.
2015-10-06 21:35:47 -04:00
Rob Rix
b04d71ede3
Compute the before-state of diffs.
...
This is `Optional`, as some diffs have unrecoverable before states. For
example, the insertion of a term has no before state, but can still
produce a valid before state if it occurs within the context of an
`Indexed` or `Keyed` node.
However, certain malformed diffs (such as `.Pure(.Insert(…))` in
isolation) may lack a valid before state, and thus the public API has
to reflect this.
2015-10-06 21:35:19 -04:00
Rob Rix
75aaebe834
Free
has a Term
typealias when appropriate.
2015-10-06 21:32:38 -04:00
Rob Rix
85ac68d232
Document why PatchConvertible.
2015-10-06 21:25:21 -04:00
Rob Rix
6b3c66d801
Patch is trivially PatchConvertible.
2015-10-06 21:24:43 -04:00
Rob Rix
46f3f9431b
Add a PatchConvertible protocol to enable constrained extensions.
2015-10-06 21:24:01 -04:00
Rob Rix
eec173c560
Pass fixtures to the tool.
2015-10-06 21:17:17 -04:00
Rob Rix
6f7552bae0
Add a couple of fixtures.
2015-10-06 21:17:09 -04:00
Rob Rix
e736116211
Evaluate the algorithm.
2015-10-06 21:02:00 -04:00
Rob Rix
2b9993c5f4
Treat protocols as groups.
2015-10-06 21:01:53 -04:00
Rob Rix
38c50d4e4a
Term is not a proper noun any more.
2015-10-06 20:53:35 -04:00
Rob Rix
e152d8702a
/dev/null -> nil
...
`git difftool` will invoke us with /dev/null when a file has been
deleted.
2015-10-06 20:48:53 -04:00
Rob Rix
b3324a6c5f
Drop null JSON.
2015-10-06 20:46:24 -04:00
Rob Rix
7e4ca06cbc
Indexed, not Branch.
2015-10-06 20:45:50 -04:00
Rob Rix
706654552f
In, not Roll.
2015-10-06 20:45:37 -04:00
Rob Rix
771f03f1fa
Indentation.
2015-10-06 20:43:27 -04:00
Rob Rix
8a6a39f06a
Construct terms for section headings.
2015-10-06 20:43:23 -04:00
Rob Rix
87d547a670
Wrap constructors in .In.
2015-10-06 20:43:02 -04:00
Rob Rix
40ecf24c9e
Fix, not Term.
2015-10-06 20:39:57 -04:00
Rob Rix
f131f40752
Construct the terms in Fix
.
2015-10-06 20:39:51 -04:00
Rob Rix
ee151d0edc
Compute the diff in FreeAlgorithm
.
2015-10-06 20:39:37 -04:00
Rob Rix
c7d9216433
Info is StringConvertible.
2015-10-06 20:38:00 -04:00
Rob Rix
c16a8b3af2
Combine the extensions.
2015-10-06 20:35:52 -04:00
Rob Rix
1059a00db0
🔥 AnyEquatable.
2015-10-06 19:20:16 -04:00
Rob Rix
939a714807
🔥 AnyHashable.
2015-10-06 19:20:06 -04:00
Rob Rix
fb41713906
Replace roll()
with Diff()
.
2015-10-06 17:48:17 -04:00
Rob Rix
47dd0b4849
Construct with Diff(), not copy().
2015-10-06 17:47:10 -04:00
Rob Rix
c9d51049df
Construct with Diff(), not copy().
2015-10-06 17:47:04 -04:00
Rob Rix
de61021d32
Once more, call it Term.
2015-10-06 17:46:37 -04:00
Rob Rix
f51f6f39a2
Call it Term.
2015-10-06 17:46:02 -04:00
Rob Rix
22773917a3
Construct Free
with Fix
.
2015-10-06 17:45:24 -04:00
Rob Rix
d097f14fcb
Explain SES implementation details a little.
2015-10-06 17:36:49 -04:00
Rob Rix
6030731cc8
Extend the graph and return Stream.Nil
at the end.
2015-10-06 17:36:41 -04:00
Rob Rix
57fb8ff251
Document the purpose of the matrix.
2015-10-06 17:29:33 -04:00
Rob Rix
833d27c54a
Test an insertion at the end.
2015-10-06 17:29:06 -04:00
Rob Rix
6e799e0b79
Test a deletion at the end.
2015-10-06 17:28:25 -04:00
Rob Rix
d7db7415dc
Patches have different costs.
2015-10-06 17:08:22 -04:00
Rob Rix
4fdbcf948f
Patches have a cost.
...
This charges `Replace` patches at a higher cost than `Insert`/`Delete`
patches to avoid spurious replacements.
2015-10-06 17:07:16 -04:00
Rob Rix
bcc3da35f9
Recur at the corner.
...
This can’t be right.
2015-10-06 17:01:27 -04:00
Rob Rix
c7aad22838
Insert/delete/recur based on the edge being followed.
2015-10-06 17:01:17 -04:00
Rob Rix
c2d4c96d62
Recurrence checks for equality.
2015-10-06 16:59:29 -04:00
Rob Rix
a1a832012e
Implement a function copying terms into diffs.
2015-10-06 16:59:11 -04:00
Rob Rix
a628177722
Move SES to its own file.
2015-10-06 16:50:23 -04:00
Rob Rix
8e0cafbac4
Info’s debug description uses its categories’ debug descriptions.
2015-10-06 16:49:14 -04:00
Rob Rix
606d721dea
Category is CustomDebugStringConvertible.
2015-10-06 16:48:44 -04:00
Rob Rix
ee8794fd81
Patch is CustomDebugStringConvertible.
2015-10-06 16:45:36 -04:00
Rob Rix
0237d5991a
Fix is CustomDebugStringConvertible.
2015-10-06 16:44:00 -04:00
Rob Rix
29d889ef95
Free is CustomDebugStringConvertible.
2015-10-06 16:43:20 -04:00
Rob Rix
64830960e5
Info is CustomDebugStringConvertible.
2015-10-06 16:41:54 -04:00
Rob Rix
db63777dd9
Represent Insert/Delete explicitly in Patch.
...
Fixes #60 .
2015-10-06 16:31:44 -04:00
Rob Rix
17191dd8ab
Correct the tests to equate arrays of diffs by element, and not by memory (!).
...
- rdar://22996431
- rdar://22996542
2015-10-06 16:23:48 -04:00
Rob Rix
3cc732f54e
Rename DiffTests to SESTests.
2015-10-06 14:25:18 -04:00
Rob Rix
0a6a136bff
🔥 Vertex & VertexTests.
2015-10-06 14:24:56 -04:00
Rob Rix
9b6a3f6e36
Remove the fixme because it has been fixed.
2015-10-06 14:23:59 -04:00
Rob Rix
2726a43c83
Lazily, not eagerly.
...
`Memo.init` selected the eager version, of course, since the lazy
version takes a closure.
2015-10-06 14:19:39 -04:00
Rob Rix
1658219d59
Document constructRowMajor
.
2015-10-06 14:17:14 -04:00
Rob Rix
092087fc54
Extract row-major ordering into a private function.
2015-10-06 14:15:21 -04:00
Rob Rix
934390a0d5
Retrieve in row-major order.
2015-10-06 14:11:36 -04:00
Rob Rix
d12c95e296
Insert in row-major order.
2015-10-06 14:11:26 -04:00
Rob Rix
e178745c56
Cache the costs for the rest of the graph at each vertex.
2015-10-06 13:33:38 -04:00
Rob Rix
6c8ce1bcb2
Append, don’t subscript.
...
Subscripting only replaces, never appends.
2015-10-06 13:29:43 -04:00
Rob Rix
a9349c33dc
Port the SES example from the paper.
2015-10-06 13:27:06 -04:00
Rob Rix
48a0935d5c
Use the little API for deletion fixtures.
2015-10-06 13:26:44 -04:00
Rob Rix
69d42e121c
Port insertion/deletion in the middle.
2015-10-06 13:25:56 -04:00
Rob Rix
9761ba3d98
Port insertion/deletion at head.
2015-10-06 13:25:27 -04:00
Rob Rix
b23a8ac6f7
Rename copy
to roll
so we can actually call it from within the tests.
2015-10-06 13:25:09 -04:00
Rob Rix
1473d5648b
Port the pure insert/delete tests.
2015-10-06 13:22:54 -04:00
Rob Rix
0d8c080f35
Add a little API for diffs.
2015-10-06 13:22:37 -04:00
Rob Rix
5a86df7a8d
Assert equality using Assertions.assert.
2015-10-06 13:16:43 -04:00
Rob Rix
cd2faed7ce
Add a typealias for diffs.
2015-10-06 13:16:32 -04:00
Rob Rix
ea09799e58
import Assertions.
2015-10-06 13:16:23 -04:00
Rob Rix
b3e6a92224
The tests link against Assertions.framework.
2015-10-06 13:16:15 -04:00
Rob Rix
8825a92ec7
Include Assertions in the workspace.
2015-10-06 13:16:05 -04:00
Rob Rix
1c4a880b09
Add Assertions as a submodule.
2015-10-06 13:13:53 -04:00
Rob Rix
286b91a88d
Add a wrapper function to compute the SES.
2015-10-06 13:12:53 -04:00
Rob Rix
1ecafbff43
Import Doubt testably.
2015-10-06 13:10:45 -04:00
Rob Rix
648945fee0
FreeAlgorithm.evaluate()
calls out to SES
.
2015-10-06 13:09:17 -04:00
Rob Rix
d2b3f16cfc
Document SES.
2015-10-06 13:08:17 -04:00
Rob Rix
90b404b3ee
Extract the SES function.
2015-10-06 13:05:49 -04:00
Rob Rix
6cef3b9884
Matrix is public.
2015-10-06 13:00:07 -04:00
Rob Rix
bdabcc5c24
Matrix.values is private.
2015-10-06 13:00:01 -04:00
Rob Rix
e4689b9102
Fix hashing is public.
2015-10-06 12:59:13 -04:00
Rob Rix
c35e31ad4a
Define the Term fixtures using Fix.
2015-10-06 12:58:07 -04:00
Rob Rix
daf5f8ed9e
Add a typealias for the Term fixtures.
2015-10-06 12:57:48 -04:00
Rob Rix
900d364057
Link to @patrickt’s tutorials on recursion schemes.
2015-10-06 12:53:30 -04:00
Rob Rix
675d355b96
Document iterate
.
2015-10-06 12:47:33 -04:00
Rob Rix
67d35078d8
Call a Term
a Term
.
2015-10-06 12:25:40 -04:00
Rob Rix
cce1ed61aa
Document FreeAlgorithm.init
.
2015-10-06 12:24:58 -04:00
Rob Rix
511ef4d1a1
Document that out-of-bound indices are safe.
2015-10-06 12:20:58 -04:00
Rob Rix
25f29c328c
Document Matrix
a little.
2015-10-06 12:19:59 -04:00
Rob Rix
cb33717fb9
🔥 Syntax.reduce
.
2015-10-06 12:17:51 -04:00
Rob Rix
69b8028750
🔥 Term.swift.
2015-10-06 12:17:38 -04:00
Rob Rix
b1af1a63a4
🔥 Diff.swift.
2015-10-06 12:17:14 -04:00
Rob Rix
4f95704c97
Remove an obsolete fixme.
2015-10-06 12:16:37 -04:00
Rob Rix
c322386cb4
Recur in dictionary diffing.
2015-10-06 12:16:19 -04:00
Rob Rix
ebca63b01e
Recur in SES.
2015-10-06 12:15:48 -04:00
Rob Rix
e14c5a7f9d
FreeAlgorithm
doesn’t need equals
or recur
when A: Equatable
& B: FreeConvertible
.
2015-10-06 12:15:28 -04:00
Rob Rix
36c8fa03c9
FreeAlgorithm
doesn’t need recur
when B: FreeConvertible
.
2015-10-06 12:15:08 -04:00
Rob Rix
1fcba3fca0
recur
actually has to return Diff
.
...
`B` will only be identified with `Diff` when `B: FreeConvertible`.
2015-10-06 12:12:47 -04:00
Rob Rix
131ae72f1a
Note that we can’t call recur
in the Recursive
strategy.
...
Paradox.
2015-10-06 12:09:18 -04:00
Rob Rix
ac0b142a40
Recur through a parameter pairing Term
s.
2015-10-06 12:07:56 -04:00
Rob Rix
f30ebc8cdb
Diff/Term typealiases are public.
2015-10-06 12:03:58 -04:00
Rob Rix
d020d17f60
Note that we need to recur in SES.
2015-10-06 12:01:39 -04:00
Rob Rix
6a11a88dea
Compute the best diff to continue with.
2015-10-06 12:01:14 -04:00
Rob Rix
eb2b242d3a
Extract the nominated next diff into a temporary.
2015-10-06 11:58:36 -04:00
Rob Rix
28d5612c44
Use costOfStream
to implement cons
.
2015-10-06 11:57:37 -04:00
Rob Rix
1ac2f8d8c0
Add a function to compute the cost of the rest of the graph.
2015-10-06 11:57:04 -04:00
Rob Rix
d7c36a30c9
Remove here
.
2015-10-06 11:55:55 -04:00
Rob Rix
84a1122ed7
Write cost
as a func
.
2015-10-06 11:55:15 -04:00
Rob Rix
cc6627bb52
Write cons
as a func
.
2015-10-06 11:54:42 -04:00
Rob Rix
c0ab03e73d
Compute the cost of the remainder of the stream.
2015-10-06 11:52:56 -04:00
Rob Rix
97b4c59a81
Rewrite the sum to wrap stream construction.
2015-10-06 11:52:13 -04:00
Rob Rix
3cdc9bd745
Simplify the Stream-unconsing.
2015-10-06 11:48:50 -04:00