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
Rob Rix
5e144553fd
Add a function to compute the cost of the rest of the diff.
2015-10-06 11:48:04 -04:00
Rob Rix
4e6dd07e78
Extract the diff.
2015-10-06 11:46:30 -04:00
Rob Rix
3919a4c093
Interpret free algorithms where we’re computing a diff.
2015-10-06 11:43:17 -04:00
Rob Rix
6e1a7c6794
Memoize a cost for diffs.
2015-10-06 11:41:37 -04:00
Rob Rix
03c5f0b644
Stub diffing in the middle of the graph.
2015-10-06 11:40:54 -04:00
Rob Rix
1d993bb65b
Diff along the right of the edit graph.
2015-10-06 11:40:42 -04:00
Rob Rix
c090fc33d5
Diff along the bottom of the edit graph.
2015-10-06 11:39:34 -04:00
Rob Rix
f442f3594f
Stub in diffing with Matrix
.
2015-10-06 11:38:50 -04:00
Rob Rix
88030e217f
Short-circuit degenerate cases.
2015-10-06 11:30:41 -04:00
Rob Rix
8dd605bb54
Add a function computing the cost of a diff.
2015-10-06 11:30:21 -04:00
Rob Rix
b910fdba46
Section header for Syntax.map.
2015-10-06 11:08:39 -04:00
Rob Rix
286ff11f79
Rename iter
to iterate
.
2015-10-06 11:05:02 -04:00
Rob Rix
8800c57ca7
Oh yeah, method dispatch works too.
2015-10-06 11:04:36 -04:00
Rob Rix
8226285153
Implement iter
as a method.
2015-10-06 11:04:14 -04:00
Rob Rix
c0edc77185
Implement iter
by case analysis.
2015-10-06 11:03:03 -04:00
Rob Rix
3da765d32b
Identity.
2015-10-06 11:02:22 -04:00
Rob Rix
3d06b533bc
Implement iter
over Free
.
2015-10-06 11:02:15 -04:00
Rob Rix
24e113d2f0
The hash
property on Free
is public.
2015-10-06 11:00:47 -04:00
Rob Rix
0be3eeb8e1
Dictionary diffing should recur.
2015-10-06 09:28:30 -04:00
Rob Rix
3fb6f24d8b
Diff indexed terms.
2015-10-05 17:30:29 -04:00
Rob Rix
b08a51a360
Abbreviate further.
2015-10-05 17:29:20 -04:00
Rob Rix
071bf6bd6f
Stub in a matrix pairing the elements to be diffed.
2015-10-05 17:27:28 -04:00
Rob Rix
d00da3f90a
Remove evaluation from Algorithm.
2015-10-05 17:26:17 -04:00
Rob Rix
b7b56b1d01
Move the body of evaluation into FreeAlgebra.
2015-10-05 17:25:47 -04:00
Rob Rix
1ef04248cb
Bring the typealiases from Algorithm into FreeAlgorithm.
2015-10-05 17:25:17 -04:00
Rob Rix
3fdda99653
Matrix is a functor.
2015-10-05 17:18:40 -04:00
Rob Rix
0e8b74e830
Matrix has a private fieldwise constructor.
2015-10-05 17:18:35 -04:00
Rob Rix
81b6c172cf
Populate the matrix with a compute function.
2015-10-05 17:12:28 -04:00
Rob Rix
c935e4a3d9
Stub in a matrix of memoized values.
2015-10-05 17:11:56 -04:00
Rob Rix
9e2b6bd3b4
Document the ByIndex
case a bit more.
2015-10-05 14:54:03 -04:00
Rob Rix
b7ebabd529
Stub in ByIndex diffing.
2015-10-05 13:17:43 -04:00
Rob Rix
80ba5fb379
More thorough documentation of FreeAlgorithm
.
2015-10-05 13:15:23 -04:00
Rob Rix
437fbd269f
Algorithm is an operation.
2015-10-05 13:14:46 -04:00
Rob Rix
847216a942
Document some elements of FreeAlgorithm.
2015-10-05 13:05:31 -04:00
Rob Rix
49aa2b3dd5
Section headers.
2015-10-05 13:02:04 -04:00
Rob Rix
30d16f87e8
Remove the free diff
function.
2015-10-05 13:00:36 -04:00
Rob Rix
e2e6a0ea03
Note the need for SES.
2015-10-05 12:51:43 -04:00
Rob Rix
4b3b1ec3d4
Top-level construction of FreeAlgorithms from Terms.
2015-10-05 12:51:05 -04:00
Rob Rix
1af75347a1
Add a hack protocol to allow an ersatz same-type requirement.
2015-10-05 12:50:47 -04:00
Rob Rix
00ae25a932
Add a function computing the FreeAlgorithm for two terms.
2015-10-05 12:33:59 -04:00
Rob Rix
81e80eae50
Evaluation of FreeAlgorithm where A: Equatable.
2015-10-05 12:32:34 -04:00
Rob Rix
346a39fafc
Evaluation of FreeAlgorithm.
2015-10-05 12:32:21 -04:00
Rob Rix
fa3be5108e
FreeAlgorithm is a monad.
2015-10-05 12:30:10 -04:00
Rob Rix
c70ab9e9a4
FreeAlgorithm is a functor.
2015-10-05 12:29:35 -04:00
Rob Rix
eea4915d6a
Add a free monad over Algorithm
.
2015-10-05 12:19:55 -04:00
Rob Rix
8f9a47cd06
Simplify the evaluation of recursive algorithms.
2015-10-05 12:13:54 -04:00
Rob Rix
300f370bcb
Spacing.
2015-10-05 12:13:25 -04:00
Rob Rix
7834548250
Algorithm implements dictionary diffing.
2015-10-05 09:24:29 -04:00
Rob Rix
bd5deecce7
Spacing.
2015-10-02 17:49:03 -04:00
Rob Rix
fce352dd85
Document why copy
.
2015-10-02 17:48:58 -04:00
Rob Rix
51903b4434
Implement an interpreter for Algorithm.
2015-10-02 17:47:11 -04:00
Rob Rix
ad93456922
Algorithm is a Functor.
2015-10-02 17:34:14 -04:00
Rob Rix
f9dcf9569c
The Recursive case contains two Terms, not one.
2015-10-02 17:32:25 -04:00
Rob Rix
b30aa91502
Algorithm is public.
2015-10-02 17:30:09 -04:00
Rob Rix
1b13580eb3
Document the Recursive
case.
2015-10-02 17:29:13 -04:00
Rob Rix
bbd41b209d
Doc comments for the Term and Diff typealiases.
2015-10-02 17:25:52 -04:00
Rob Rix
f26d4349c7
Documentation comment for the Algorithm type.
2015-10-02 17:25:40 -04:00
Rob Rix
8da57b5e78
Stub in the language of diffing algorithms.
2015-10-02 17:21:51 -04:00
Rob Rix
20bea59868
Add a Keyed case to Syntax.
2015-10-02 17:18:38 -04:00
Rob Rix
6657c5c0a5
Fix the debug description.
2015-10-02 17:13:27 -04:00
Rob Rix
7c69de54bc
Rename Branch to Indexed.
2015-10-02 17:12:49 -04:00
Rob Rix
395fa8446f
Note my keen desire to 🔥 Syntax.reduce forever.
2015-10-02 17:11:35 -04:00
Rob Rix
5ff17c8fc0
Syntax.Branch holds an array again.
2015-10-02 17:11:02 -04:00
Rob Rix
ebb3f1350f
Conveniences for constructing insertions & deletions.
2015-10-02 16:53:43 -04:00
Rob Rix
ae7f30e922
Parameterized Patch hashing.
2015-10-02 16:50:59 -04:00
Rob Rix
ca6392e636
Parameterized Patch equality.
2015-10-02 16:49:04 -04:00
Rob Rix
9a19d477df
Parameterized Optional equality.
2015-10-02 16:48:44 -04:00
Rob Rix
40291e2715
Move the function composition operator into the Operators file.
2015-10-02 16:42:42 -04:00
Rob Rix
089bd51fb3
Rename the property.
2015-10-02 16:38:21 -04:00
Rob Rix
48c2112124
Add a property destructuring Patches.
2015-10-02 16:38:02 -04:00
Rob Rix
0c4fe23e78
Doc comment for Patch.
2015-10-02 16:36:05 -04:00
Rob Rix
5c10f5ccc9
Stub in Patch.
2015-10-02 16:34:00 -04:00
Rob Rix
76441c3775
Fix implements hash
where A is Hashable.
2015-10-02 16:31:49 -04:00
Rob Rix
bccc09d39b
Fix hashing.
2015-10-02 16:31:10 -04:00
Rob Rix
96e5cd0e7a
Abbreviate Fix equality.
2015-10-02 16:28:57 -04:00
Rob Rix
277757e3a2
Free implements hash
when A and B are Hashable.
2015-10-02 16:27:44 -04:00
Rob Rix
e4d0a41093
Express flatMap
with analysis
.
2015-10-02 14:36:01 -04:00
Rob Rix
b4479e3854
Express map
with analysis
.
2015-10-02 14:35:18 -04:00
Rob Rix
2b5b85e0b4
Define Free hashing.
2015-10-02 14:35:07 -04:00
Rob Rix
f14433871b
Parameterize by leaf hashing.
2015-10-02 14:33:41 -04:00
Rob Rix
3d40071b44
Give the hash parameter an external label.
2015-10-02 14:32:35 -04:00
Rob Rix
334bb3017e
The roll function doesn’t escape.
2015-10-02 14:29:45 -04:00
Rob Rix
7d49895796
Section headers for functor/monad instances.
2015-10-02 14:27:37 -04:00
Rob Rix
7e00f9297e
Implement case analysis for Free.
2015-10-02 14:26:53 -04:00
Rob Rix
de2dcf4bf4
== over Free.
2015-10-02 14:18:43 -04:00
Rob Rix
a0e77e2495
== over Fix.
2015-10-02 14:17:59 -04:00
Rob Rix
bc857f810b
Fix Equality.
2015-10-02 14:17:25 -04:00
Rob Rix
87994c824f
Free Equality.
2015-10-02 14:15:17 -04:00
Rob Rix
43bdcd45c9
Parameterize Syntax equality by leaf type equality.
2015-10-02 14:15:13 -04:00
Rob Rix
296dbeea8f
Add a section mark for Syntax equality.
2015-10-02 14:12:54 -04:00
Rob Rix
6d5fd97552
Add an external label for recurrence equality.
2015-10-02 14:12:46 -04:00
Rob Rix
45a7e372b5
Rename the recur parameter.
2015-10-02 14:12:19 -04:00
Rob Rix
f8c37695ae
Document Fix’s case.
2015-10-02 14:08:03 -04:00
Rob Rix
b2219feed7
Document Free’s cases.
2015-10-02 14:07:29 -04:00
Rob Rix
0a64dc8741
Free is indeed a Monad.
2015-10-02 14:03:34 -04:00
Rob Rix
97686157f3
Free is a Functor.
2015-10-02 13:59:55 -04:00
Rob Rix
e63ccff83f
Documentation for Free.
2015-10-02 13:54:39 -04:00
Rob Rix
ad3d4b6c3f
Backticks around types.
2015-10-02 13:54:34 -04:00
Rob Rix
0ff70be000
Stub in Free.
2015-10-02 13:43:43 -04:00
Rob Rix
da3c1041e0
Fix is public.
2015-10-02 13:42:55 -04:00
Rob Rix
bf75fcab61
Add Fix, the fixpoint of Syntax.
2015-10-02 13:21:43 -04:00
Rob Rix
cfb8cb92b9
Merge branch 'master' into optional-instead-of-empty
2015-10-02 13:06:42 -04:00
Rob Rix
ea5d9ef814
Merge branch 'master' into operators-alongside-operands
2015-10-02 13:05:23 -04:00
Rob Rix
cacba977dd
Expand on the documentation of Copy.
2015-10-02 13:02:51 -04:00
Rob Rix
a96a88cdf8
Document magnitude
a little.
2015-10-02 12:58:34 -04:00
Rob Rix
05a7c1a037
Remove Syntax.Empty.
2015-10-02 12:37:09 -04:00
Rob Rix
3cae5390b7
Inserts and Deletes Patch with nil.
2015-10-02 12:31:30 -04:00
Rob Rix
6eb840f795
Remove the Tree constructor wrappers.
2015-10-02 12:31:19 -04:00
Rob Rix
730790fec7
Patch states can be Optional.
2015-10-02 12:24:51 -04:00
Rob Rix
2ab10d6b3d
Empty Hashes.
2015-10-02 12:24:18 -04:00
Rob Rix
49721679b6
Move Term equality into its file.
2015-10-01 15:26:15 -04:00
Rob Rix
906e502def
Move Syntax equality into its file.
2015-10-01 15:25:49 -04:00
Rob Rix
4823a47f23
Rephrase parameterized equality as a static function.
2015-10-01 15:25:14 -04:00
Rob Rix
6a6b146863
Move Doc equality to its file.
2015-10-01 15:17:07 -04:00
Rob Rix
146f59bc23
Move Vertex equality to its file.
2015-10-01 15:16:25 -04:00
Rob Rix
91e119cde7
Diff’s Comparable implementation lives alongside it.
2015-10-01 15:15:30 -04:00
Rob Rix
bba8dacbc4
Some documentation comments.
2015-10-01 14:25:17 -04:00
Rob Rix
8961ee9168
Branch has only one child.
2015-10-01 14:08:13 -04:00
Rob Rix
0e7bc6b2b3
Stub in a ByIndex case for SES diffing.
2015-10-01 14:01:59 -04:00
Rob Rix
533e4578ea
Comma-separate.
2015-10-01 14:01:19 -04:00
Rob Rix
12663f1158
Add ByKey to Diff.
2015-10-01 13:54:23 -04:00
Rob Rix
dda95ed386
Require Term’s leaf type to be Equatable.
...
This is a bit of a hack.
2015-10-01 13:52:32 -04:00
Rob Rix
fb247732cc
Move diff equality into Diff.swift.
2015-10-01 11:34:17 -04:00
Rob Rix
8bac863ca0
Hash is AlgebraicHashable.
2015-10-01 10:46:25 -04:00
Rob Rix
009920606b
Add unordered hashing.
2015-10-01 10:45:47 -04:00
Rob Rix
cdd05ab556
Extract the calculation of the magnitude of a syntax node into a function.
2015-10-01 10:45:23 -04:00
Rob Rix
97da6a15e4
Document Diff’s cases.
2015-10-01 10:45:06 -04:00
Rob Rix
2394ea3545
Correct AnyEquatable equality.
2015-10-01 10:34:36 -04:00
Rob Rix
fae5fc5123
Correct Syntax.hash() to refer to Ordered.
2015-10-01 10:33:47 -04:00
Rob Rix
12491dde7a
AnyHashable convenience constructor.
2015-10-01 10:32:44 -04:00
Rob Rix
3ea42437f9
Abstract AnyHashable over AnyEquatable.
2015-10-01 10:31:18 -04:00
Rob Rix
39bbe4df42
AnyEquatable can unpack its value.
2015-10-01 10:29:48 -04:00
Rob Rix
72c1029d33
AnyHashable can unpack its value.
2015-10-01 10:28:24 -04:00
Rob Rix
079b3a479e
AnyEquatable.
2015-10-01 10:28:14 -04:00
Rob Rix
279aab6530
Rename Sequence to Ordered.
2015-10-01 10:09:44 -04:00
Rob Rix
a2a55531c9
AnyHashable.
2015-10-01 09:59:26 -04:00
Rob Rix
18d74a9d9c
Diff is AlgebraicHashable.
2015-10-01 09:54:56 -04:00
Rob Rix
0013475516
Terms of Hashable leaf type can be hashed.
2015-10-01 09:54:44 -04:00
Rob Rix
c698280fc2
Pass the hashing function for the Recur type in.
2015-10-01 09:53:30 -04:00
Rob Rix
1635b8ab8a
Info is AlgebraicHashable.
2015-10-01 09:46:02 -04:00
Rob Rix
5dd80cb0ce
Diff is defined over Term<Info>.
...
This enables diffs to operate on categorized Terms.
2015-09-30 16:05:39 -04:00
Rob Rix
84eeba6111
Info has a property for its Categories.
2015-09-30 16:02:01 -04:00
Rob Rix
d29e14508a
Info has a Set of Categories.
2015-09-30 16:01:47 -04:00
Rob Rix
1ed5fc0e88
Categories are Hashable.
2015-09-30 16:00:13 -04:00
Rob Rix
282f56fb90
Categories have an accessor for their tag.
2015-09-30 16:00:03 -04:00
Rob Rix
5abbd36a80
Replace Location with Info.
2015-09-30 15:58:01 -04:00
Rob Rix
ddbe0943ef
Location is Equatable.
2015-09-30 15:46:21 -04:00
Rob Rix
66281a6674
Document Literal Locations.
2015-09-30 15:46:16 -04:00
Rob Rix
0efffe3e3d
Add source locations.
2015-09-30 15:29:56 -04:00
Rob Rix
459bad4dd6
Categories are equatable.
2015-09-30 15:29:40 -04:00
Rob Rix
f3122f1bae
Move JSON construction of Term into doubt-swift.
2015-09-30 15:08:19 -04:00
Rob Rix
03d4fcfc53
Add Category.
2015-09-30 15:03:47 -04:00
Rob Rix
d7a8c64806
Abbreviate the properties.
2015-09-30 15:03:42 -04:00
Rob Rix
82720340ef
Wrap with Term().
2015-09-30 15:03:37 -04:00
Rob Rix
d8c718130b
Lose an annotation.
2015-09-30 15:03:30 -04:00
Rob Rix
a6358b22d4
Remove CustomHashConvertible.
2015-09-30 15:02:31 -04:00
Rob Rix
2d0991b91f
Abstract Term over a type parameter A.
2015-09-30 14:42:58 -04:00
Rob Rix
a2b9f9ce17
Implement Syntax equality using a function which expresses the equality of the functor.
2015-09-30 14:42:44 -04:00
Rob Rix
92d844f416
Extract the exception-for-control-flow ErrorType to global scope.
2015-09-30 14:40:30 -04:00
Rob Rix
88b677e1e0
Parameterize the type of Leaf.
2015-09-30 12:41:20 -04:00
Rob Rix
5529a502e3
Require Recur to be Hashable.
2015-09-30 12:40:49 -04:00
Rob Rix
de3ef64f48
Map using Hash.init.
2015-09-30 12:40:36 -04:00
Rob Rix
5fa07014a6
Replace all the other nodes with Branch.
2015-09-30 11:42:41 -04:00
Rob Rix
a0f562d25e
Leaves, not Literals.
2015-09-30 11:03:55 -04:00
Rob Rix
4712e1c2cc
Add CustomHashConvertible for non-Equatable objects that can be converted to Hashes.
2015-09-30 10:46:01 -04:00
Rob Rix
66b225fce3
Replace Case with a constructor.
2015-09-30 10:44:48 -04:00
Rob Rix
565800b1b0
Add a constructor for Int hashes.
2015-09-30 10:43:18 -04:00
Rob Rix
9841debe91
No longer need to disambiguate String.
2015-09-30 10:42:43 -04:00
Rob Rix
b581b8b71d
Rename String to Label.
2015-09-30 10:42:27 -04:00
Rob Rix
d9eb3f6a69
Don’t need to disambiguate Int now.
2015-09-30 10:40:45 -04:00
Rob Rix
0cdb09a964
Rename the Int case to Raw.
2015-09-30 10:40:28 -04:00
Rob Rix
66141c95af
Replace Literal/Variable with Leaf.
2015-09-30 10:36:25 -04:00
Rob Rix
1f253f4e12
Add a phantom type parameter to Syntax.
2015-09-30 10:31:48 -04:00
Rob Rix
308f81853d
Rename the Payload type to Recur.
2015-09-30 10:29:38 -04:00
Rob Rix
4348604e66
Remove the typealias.
2015-09-30 10:29:32 -04:00
Rob Rix
31d35c854b
Term is AlgebraicHashable.
2015-09-29 17:03:18 -04:00
Rob Rix
586def93cd
Syntax<A: AlgebraicHashable> implements hash
.
2015-09-29 17:03:11 -04:00
Rob Rix
7925347d21
Debug print abstraction bodies correctly.
2015-09-29 17:02:57 -04:00
Rob Rix
1cf92c94d0
Conveniences for labelled/numbered enum cases.
2015-09-29 17:02:35 -04:00
Rob Rix
f1c2f4b9e0
Algebraic hashing of RawRepresentable types whose RawValue is [Algebraic]Hashable.
2015-09-29 17:02:01 -04:00
Rob Rix
b60df96019
Construction of Hash from Hashable/AlgebraicallyHashable values.
2015-09-29 17:01:38 -04:00
Rob Rix
e32bb2af29
Add a protocol for algebraically hashable types.
...
They’ll get `hashValue` for free.
2015-09-29 17:00:52 -04:00
Rob Rix
278bba4f82
Add an algebraic Hash type.
2015-09-29 17:00:26 -04:00
Rob Rix
29de111b1c
How did this even build?
2015-09-29 12:57:17 -04:00
Rob Rix
60821016a2
Revert "Empty terms are copied, not patched."
...
This reverts commit 788dbaa07ceafc084dc0f10f74efc2aa2a6841ec.
2015-09-29 12:54:42 -04:00
Rob Rix
dfbfb9fe79
Short-circuit for equal terms.
2015-09-29 12:54:32 -04:00
Rob Rix
7d36421d6a
Empty terms are copied, not patched.
2015-09-29 12:53:04 -04:00
Rob Rix
94bcc7d3f0
Remove empty diffs.
2015-09-29 12:50:34 -04:00
Rob Rix
35581fa6d9
Resume using .Empty for Terms.
2015-09-29 12:49:36 -04:00
Rob Rix
50e8223f18
Whitespaaaace.
2015-09-29 12:49:19 -04:00
Rob Rix
c3e8d9a801
Remove Term.Empty.
2015-09-29 12:48:53 -04:00
Rob Rix
17271ff2ce
Add a constructor for empty terms.
2015-09-29 12:48:35 -04:00
Rob Rix
1bb9cbbbd4
Empty syntaxes are equatable.
2015-09-29 12:48:13 -04:00
Rob Rix
8c1b249df2
Add an Empty case to Syntax.
2015-09-29 12:44:47 -04:00
Rob Rix
feff05b0c8
Move Layout to the end of the file.
2015-09-28 23:33:50 -04:00
Rob Rix
cfc92283db
Layout is private.
2015-09-28 22:59:24 -04:00
Rob Rix
61bb6cff93
Use group as a method.
2015-09-28 22:58:24 -04:00
Rob Rix
8acde46998
group as a method.
2015-09-28 22:58:10 -04:00
Rob Rix
c6765e052a
Replace the static bracket function.
2015-09-28 22:57:29 -04:00
Rob Rix
42cee56ef8
Bracket as an instance method.
2015-09-28 22:56:18 -04:00
Rob Rix
c4f710efd1
Don’t spread explicitly.
2015-09-28 22:54:41 -04:00
Rob Rix
d72913a0d3
Don’t fold explicitly.
2015-09-28 22:54:10 -04:00
Rob Rix
a63a4410fd
Replace the stack function with an extension method.
2015-09-28 22:53:23 -04:00
Rob Rix
d0b6617ce6
Replace the spread function with an extension method.
2015-09-28 22:53:15 -04:00
Rob Rix
28d66524bf
Use joinWithSeparator.
2015-09-28 22:50:59 -04:00
Rob Rix
e6133ac036
Implement joinWithSeparator in the extension.
2015-09-28 22:49:41 -04:00
Rob Rix
fa763cbccc
Use the fold extension method.
2015-09-28 22:48:13 -04:00
Rob Rix
ca3f07d76f
Add an extension to SequenceType for folding sequences of docs.
2015-09-28 22:47:02 -04:00
Rob Rix
f6cb4341a3
Rename some parameters that got caught by find/replace.
2015-09-28 22:46:35 -04:00
Rob Rix
5fbc3b5102
Avoid extra spaces in comma-separated lists.
2015-09-28 22:41:51 -04:00
Rob Rix
f4f5ad1e86
Rename DOC to Doc.
2015-09-28 22:36:22 -04:00
Rob Rix
f00eebca59
DOC is CustomDocConvertible.
2015-09-28 22:33:25 -04:00
Rob Rix
331999076c
DOC is Equatable.
2015-09-28 22:33:18 -04:00
Rob Rix
060216cff4
Equality of DOCs.
2015-09-28 22:30:56 -04:00
Rob Rix
f42dc8dafe
Rename Doc to Layout.
2015-09-28 22:28:37 -04:00
Rob Rix
c6cedbc751
Formatting.
2015-09-28 22:27:46 -04:00
Rob Rix
b79bbfad62
Abbreviate some uses of doc
a little.
2015-09-28 22:26:37 -04:00
Rob Rix
425e6bd8f9
better
is a static function.
2015-09-28 22:23:23 -04:00
Rob Rix
11ea7c6f17
Rename some parameters.
2015-09-28 22:22:41 -04:00
Rob Rix
810d562424
Replace be
with an initializer.
2015-09-28 22:22:13 -04:00
Rob Rix
d8be60d842
Rename be
’s parameters.
2015-09-28 22:17:06 -04:00
Rob Rix
749fe83e81
Rename the parameter to placed
.
2015-09-28 22:17:00 -04:00
Rob Rix
6d16f3924d
best
is a method.
2015-09-28 22:16:19 -04:00
Rob Rix
1829404979
fits
is a method.
2015-09-28 22:12:08 -04:00
Rob Rix
9928fdaa77
Make pretty
a method on DOC.
2015-09-28 17:13:10 -04:00
Rob Rix
2ef4ca02a1
Extract pretty from the extension.
2015-09-28 17:10:12 -04:00
Rob Rix
d3b27cfba4
Add a DOC type which constructs Doc.
...
Following Wadler.
2015-09-28 17:06:52 -04:00
Rob Rix
0c8303f27b
Add a constructor for single-element Streams.
2015-09-28 17:06:01 -04:00
Rob Rix
119fdaed78
Add Doc operators.
2015-09-28 17:05:36 -04:00
Rob Rix
9147dd72db
Add a test of SES over slightly longer sequences to demonstrate the performance problem.
2015-09-28 14:28:36 -04:00
Rob Rix
a7ea2ae201
Avoid recomputing the magnitudes.
2015-09-28 14:21:13 -04:00
Rob Rix
b43a5eaf26
Revert "Diff using Vertex."
...
This reverts commit 881436e01d381b404c12e9c63a8634d6110d251a.
2015-09-28 14:17:55 -04:00
Rob Rix
7237ecd7e4
Diff using Vertex.
2015-09-28 14:17:48 -04:00
Rob Rix
b1a3c8046e
Vertex emptiness.
2015-09-28 12:09:43 -04:00
Rob Rix
1a6f6b588b
Add a Fibonacci stream to the tests.
2015-09-28 10:29:31 -04:00
Rob Rix
48bee808f6
Correct take
’s semantics.
2015-09-28 10:28:44 -04:00
Rob Rix
d110a149dc
Taking of n values from streams.
2015-09-28 10:02:31 -04:00
Rob Rix
b97e2e4833
Test Vertex construction.
2015-09-28 09:55:04 -04:00
Rob Rix
4a16b06e92
Correct bogus equality tests.
2015-09-28 09:54:44 -04:00
Rob Rix
1a44c5ee7a
Correct the inversion of alternating rows.
2015-09-25 18:50:59 -04:00
Rob Rix
da12af7313
Stream zipping.
2015-09-25 13:57:35 -04:00
Rob Rix
00f1daa61a
Construct vertices in row-major order.
2015-09-25 12:52:59 -04:00
Rob Rix
a0edc9fe49
Vertex is CustomStringConvertible.
2015-09-25 12:45:10 -04:00
Rob Rix
18bcad0165
Vertex is CustomDebugStringConvertible.
2015-09-25 12:44:20 -04:00
Rob Rix
3dc89059ac
Avoid an excess map.
2015-09-25 12:43:54 -04:00
Rob Rix
98e66acdbf
Row-/column-major streams of vertices.
2015-09-25 12:38:11 -04:00
Rob Rix
652d1f9db4
Add row/column implementations back using Stream.unfold.
2015-09-25 12:37:58 -04:00
Rob Rix
21f3bc9dcc
Xcode did not delete this before, apparently.
2015-09-25 12:37:42 -04:00
Rob Rix
39c46edeb9
Implement the eliminators with analysis.
2015-09-25 12:37:08 -04:00
Rob Rix
24bc2610ff
Add a case analysis method.
2015-09-25 12:36:11 -04:00
Rob Rix
0a88c407e5
Construct streams with unfold.
2015-09-25 12:22:31 -04:00
Rob Rix
8178904a36
Generalize Vertex construction to arbitrary sequences.
2015-09-25 11:57:53 -04:00
Rob Rix
ece5c942d5
Memo can print itself.
2015-09-25 11:57:28 -04:00
Rob Rix
b25095372a
Revert "Memo does not need the evaluated label."
...
This reverts commit 238df4a1b54752041f134375569049c2afd79632.
2015-09-24 18:26:23 -04:00
Rob Rix
b76d361412
Vertex equality.
2015-09-24 18:24:05 -04:00
Rob Rix
a70fc630aa
Add an element property to Vertex.
2015-09-24 18:23:56 -04:00
Rob Rix
f1e06015d0
Work around a runtime deadlock.
2015-09-24 18:23:48 -04:00
Rob Rix
6e0cf0d6a1
Memo does not need the evaluated label.
2015-09-24 18:23:38 -04:00
Rob Rix
8387f5ce71
Vertices can be constructed from pairs of streams.
2015-09-24 15:45:56 -04:00
Rob Rix
089d5417aa
Remove row, column, X, and Y from Vertex.
...
This is a more wasteful representation but we can deal with that later.
2015-09-24 15:45:36 -04:00
Rob Rix
40211726bc
Add a lazy right-fold to Stream.
2015-09-24 15:10:56 -04:00
Rob Rix
abb625b501
Edit graph vertices.
2015-09-24 13:28:46 -04:00
Rob Rix
a6c419c6e1
Support enums, structs, and variables.
2015-09-23 18:22:27 -04:00
Rob Rix
975ac8fc2f
Term initialization is partial.
2015-09-23 17:37:53 -04:00
Rob Rix
0a4dd8111f
Spit out reflected diffs.
2015-09-23 17:37:29 -04:00
Rob Rix
3a90f09363
Remove the temporary arguments.
2015-09-23 17:01:43 -04:00
Rob Rix
5879e24a10
Copy frameworks into the .app.
2015-09-23 17:01:28 -04:00
Rob Rix
75aa4c0527
Don’t code sign.
2015-09-23 17:01:21 -04:00
Rob Rix
5524e85653
/dev/null → .Empty
2015-09-23 17:01:09 -04:00
Rob Rix
bf350ee2ed
Bump SourceKitten.
2015-09-23 17:00:57 -04:00
Rob Rix
1c60f97bbf
Print the diff between the files.
2015-09-23 16:39:30 -04:00
Rob Rix
53270aacfa
Try to construct terms for the argument files.
2015-09-23 16:37:22 -04:00
Rob Rix
7d05f5206b
Add a BoundsCheckedArray for unpacking arguments.
2015-09-23 16:34:07 -04:00
Rob Rix
ce6fd43eaf
Term JSON constructors are public.
2015-09-23 16:27:29 -04:00
Rob Rix
8f78776d6a
Public constructor for JSON.
2015-09-23 16:26:00 -04:00
Rob Rix
a3aefe8e37
Use a .app target instead.
2015-09-23 16:04:19 -04:00
Rob Rix
74e93a14de
Move Term/JSON conversion into Term.
2015-09-23 13:34:45 -04:00
Rob Rix
9fa5aba516
Add a Swift diff tool target.
2015-09-23 13:32:17 -04:00
Rob Rix
18d35a0beb
Share the Doubt scheme.
2015-09-23 13:31:42 -04:00
Rob Rix
95697e15f8
Doubt.framework does not need to link against SourceKittenFramework &c.
2015-09-23 13:29:05 -04:00
Rob Rix
bd7bcaea00
Explicitly annotate types so we can call without extra parentheses.
2015-09-23 12:32:25 -04:00
Rob Rix
22fa931d4d
Use Term.Roll.
2015-09-23 12:31:28 -04:00
Rob Rix
04550ca9bd
Remove SwiftAST.
2015-09-23 11:35:38 -04:00
Rob Rix
00ff3c2447
We no longer need to namespace these.
2015-09-23 11:34:35 -04:00
Rob Rix
6571de8514
Remove Prism.
2015-09-23 11:34:00 -04:00
Rob Rix
9fdd9f1109
Remove Array/DictionaryConvertible.
2015-09-23 11:33:55 -04:00
Rob Rix
68965379f7
Remove the JSON Prisms.
2015-09-23 11:33:34 -04:00
Rob Rix
7ef8a3f8c0
Clean up.
2015-09-22 17:41:02 -04:00
Rob Rix
f61b025c80
Unpack methods/functions differently from classes/extensions.
2015-09-22 17:40:23 -04:00
Rob Rix
0b6f81f8b7
Don’t test the prism.
2015-09-22 17:39:55 -04:00
Rob Rix
0c5c3910f6
Print the bodies of abstractions.
2015-09-22 17:35:41 -04:00
Rob Rix
8b6e1c1c08
Fix an infinite loop in Doc construction.
...
I don’t know how this managed never to be tested.
2015-09-22 17:33:56 -04:00
Rob Rix
5b1f35d7ff
Term constructors.
2015-09-22 17:26:45 -04:00
Rob Rix
a6473b9eff
Abstractions can have >1 elements in their body.
2015-09-22 17:23:48 -04:00
Rob Rix
0c4e9a0b58
Construct a Term from the JSON.
2015-09-22 17:18:22 -04:00
Rob Rix
b7647a46ed
Use the temporary.
2015-09-22 17:17:58 -04:00
Rob Rix
9612325ea8
Add an extension to Term constructing it from JSON.
2015-09-22 17:16:58 -04:00
Rob Rix
401d0b4194
Capture the dictionary in a temporary.
2015-09-22 17:16:38 -04:00
Rob Rix
4a51b786d3
Capture the path in a temporary.
2015-09-22 17:16:25 -04:00
Rob Rix
b1c8394a8f
Convenience constructor for JSON from AnyObject.
2015-09-22 17:15:55 -04:00
Rob Rix
aa82ed1a2b
Remove Swift AST parsing.
2015-09-21 17:35:38 -04:00
Rob Rix
e54bc56d13
Extract document structure with SourceKitten.
2015-09-21 17:32:41 -04:00
Rob Rix
1e9be8b9b0
Prism conjunction.
2015-09-21 17:23:29 -04:00
Rob Rix
1d0a54d62a
Rename Swift to SwiftAST.
2015-09-21 17:01:00 -04:00
Rob Rix
514a863547
Add a mapping convenience for constructed Prisms.
2015-09-21 16:46:48 -04:00
Rob Rix
5daa7d4398
Don’t bother with Iso.
2015-09-21 16:46:32 -04:00
Rob Rix
13f1d70071
We really don’t need this old thing.
2015-09-21 16:45:52 -04:00
Rob Rix
83e3c8e232
Missed a rename.
2015-09-21 16:45:45 -04:00
Rob Rix
ddc020c774
Rename Array/DictionaryType to Array/DictionaryConvertible.
2015-09-21 16:44:24 -04:00
Rob Rix
07d01dc79a
Move DictionaryType to its own file.
2015-09-21 16:43:22 -04:00
Rob Rix
56569eeb73
Move ArrayType to its own file.
2015-09-21 16:42:52 -04:00
Rob Rix
1ec7e5b06c
Extension methods use the converter and wrap the static prisms.
2015-09-21 16:28:04 -04:00
Rob Rix
806ea1ea93
Add a JSONConverter property to JSONConvertibles.
2015-09-21 16:27:45 -04:00
Rob Rix
b5efc49129
Restore the static prisms.
2015-09-21 16:25:34 -04:00
Rob Rix
0ca911e603
JSON/Prism extensions are public.
2015-09-21 16:08:43 -04:00
Rob Rix
7e40055294
Add .map to Prisms taking an Iso.
2015-09-21 16:05:58 -04:00
Rob Rix
1f3d05ae23
Add Iso.
2015-09-21 16:05:29 -04:00
Rob Rix
3efd234eea
Dictionary/array extensions are public.
2015-09-21 15:59:52 -04:00
Rob Rix
20a7520181
Move dictionary/array extensions into Prism.
2015-09-21 15:59:17 -04:00
Rob Rix
92482ddbab
Replace (most of) the static Prisms with properties in a constrained extension on Prism.
2015-09-21 15:53:30 -04:00
Rob Rix
fda61501e1
Array Prism subscripting is safe.
2015-09-21 15:42:07 -04:00
Rob Rix
0eca419468
Subscripting Prism<T, [U]> by Int produces Prism<T, U>.
2015-09-21 15:41:01 -04:00
Rob Rix
4f97a6bc4a
Subscripting Prism<T, [K:V]> by K returns Prism<T,V>.
2015-09-21 15:40:43 -04:00
Rob Rix
c03c01f726
Typealiases for array/dictionary types.
2015-09-21 15:29:27 -04:00
Rob Rix
a787679652
JSON is public.
2015-09-21 15:23:16 -04:00
Rob Rix
d82acf8b9f
Add a public constructor.
2015-09-21 15:23:01 -04:00
Rob Rix
78ae28a1ae
forward/backward are public.
2015-09-21 15:22:55 -04:00
Rob Rix
e989c8aac5
Prism & its concatenation are public.
2015-09-21 15:22:14 -04:00
Rob Rix
21e1b7e3e9
toJSON/toAnyObject are private.
2015-09-21 15:21:31 -04:00
Rob Rix
fb48f88575
Move the prisms into the JSON namespace.
2015-09-21 15:21:09 -04:00
Rob Rix
700a7004c4
Add a representation of JSON & prisms for encoding/casting.
2015-09-21 15:20:33 -04:00
Rob Rix
8625c90aaa
Add Prisms.
2015-09-21 15:19:49 -04:00
Rob Rix
3ff518ac46
Add a dictionary constructor over key/value pairs.
2015-09-21 15:19:42 -04:00
Rob Rix
c1f9dd3dd7
Xcode loves breaking search paths.
2015-09-21 11:17:19 -04:00
Rob Rix
de2c7f5169
Add & link SourceKitten & dependencies.
2015-09-21 11:14:31 -04:00
Rob Rix
ab4ec9e0aa
Add a root parser taking multiple sexprs.
2015-09-18 16:36:14 -04:00
Rob Rix
ca5298da88
Test that empty branches can be produced.
2015-09-18 16:32:07 -04:00
Rob Rix
8b1afceaad
Atoms are equatable.
2015-09-18 16:31:54 -04:00
Rob Rix
dfde9f26b9
Prioritize key/value pairs ahead of atoms.
2015-09-18 16:31:47 -04:00
Rob Rix
b71b40bf6f
Atoms must be one or more character.
2015-09-18 16:31:25 -04:00
Rob Rix
654492158a
Symbol nodes can be equated.
2015-09-18 16:31:05 -04:00
Rob Rix
04a207f71b
Parse symbols.
2015-09-18 16:03:58 -04:00
Rob Rix
4b3ea05f8e
This is just the worst test of alphabetic characters I can imagine.
2015-09-18 16:02:41 -04:00
Rob Rix
bcec39379d
Allow atoms to occur in branches.
2015-09-18 15:58:01 -04:00
Rob Rix
b80e8cb527
Extract a parser for atoms.
2015-09-18 15:56:53 -04:00
Rob Rix
3b6838097f
Test branch parsing.
2015-09-18 15:44:11 -04:00
Rob Rix
23f8a99867
S-expression parsing includes branches and key/value pairs.
2015-09-18 15:43:23 -04:00
Rob Rix
b5cdad9f32
Remove a bogus space.
2015-09-18 15:43:04 -04:00
Rob Rix
4f1181c51e
Add a delay combinator.
2015-09-18 15:42:53 -04:00
Rob Rix
abb63b7c4d
Words can contain _.
2015-09-18 15:38:05 -04:00
Rob Rix
a918261abc
Use concat.
2015-09-18 15:37:53 -04:00
Rob Rix
08d07baef7
Allow values to be quoted or non-ws strings.
2015-09-18 15:08:37 -04:00
Rob Rix
73da6e2d32
No zero-width matches from not
.
2015-09-18 15:08:24 -04:00
Rob Rix
c46c35157a
Values can be quoted.
2015-09-18 15:04:04 -04:00
Rob Rix
fbcd667a4c
Full parser.
2015-09-18 15:03:50 -04:00
Rob Rix
37612e763a
Combinator which matches a character when its argument does not.
2015-09-18 15:03:42 -04:00
Rob Rix
0224ccc5c7
Move never
in with the other parsers.
2015-09-18 13:53:12 -04:00
Rob Rix
56c139cd0b
Test that the key value parser accepts alphabetic keys & values.
2015-09-18 13:46:52 -04:00
Rob Rix
c92dbc446b
The Swift AST is Equatable.
2015-09-18 13:45:47 -04:00
Rob Rix
2edb3b60f1
Move all the parsers into Swift.Parsers.
2015-09-18 13:43:25 -04:00
Rob Rix
cce9fe71b8
Whitespace has some places it can be.
2015-09-18 13:43:08 -04:00
Rob Rix
8191905eaf
Add a simple tree type representing Swift AST.
2015-09-18 13:39:28 -04:00
Rob Rix
079518a3f4
Add words.
2015-09-18 13:39:08 -04:00
Rob Rix
ec19009614
Move the S-expression parser into the library.
2015-09-18 11:24:05 -04:00
Rob Rix
8cdb91b5c4
Remove the lambda calculus parser.
2015-09-18 11:23:47 -04:00
Rob Rix
29cc2ed663
Character class from sequences of characters.
2015-09-18 11:23:05 -04:00
Rob Rix
3317e8778b
Doubt is testable.
2015-09-18 11:19:12 -04:00
Rob Rix
5c7132a3bd
Rename Fix to Term.
2015-09-18 10:12:34 -04:00
Rob Rix
70d55b81dd
Full SES.
2015-09-17 15:57:04 -04:00
Rob Rix
318d8f2ea9
Test SES inserting/deleting in the middle.
2015-09-17 15:56:53 -04:00
Rob Rix
3885572e72
Test SES deleting at head.
2015-09-17 15:56:01 -04:00
Rob Rix
8c642c6f94
Test SES inserting at head.
2015-09-17 15:55:30 -04:00
Rob Rix
1fd445c1ef
min-with-comparator.
2015-09-17 15:55:11 -04:00
Rob Rix
6e3d6a2209
Construct diffs from terms.
2015-09-17 15:55:01 -04:00
Rob Rix
8a4a205055
Recursive implementation.
2015-09-17 15:12:49 -04:00
Rob Rix
afab45e68a
Stream is a monad.
2015-09-17 14:36:40 -04:00
Rob Rix
128361bbe8
Memo is a monad.
2015-09-17 14:36:34 -04:00
Rob Rix
afaa68b1e0
Add a concat overload over Memo<Stream>.
2015-09-17 14:34:39 -04:00
Rob Rix
25a88b3c69
const.
2015-09-17 14:34:26 -04:00
Rob Rix
3187d564e1
Abbreviate Stream.concat.
2015-09-17 14:30:49 -04:00
Rob Rix
e99c67ad42
Abbreviate Stream.map.
2015-09-17 14:30:41 -04:00
Rob Rix
e118119dd3
Align with the types.
2015-09-17 14:27:52 -04:00
Rob Rix
87e4d6ccfc
map using analysis to work around a compiler crash.
2015-09-17 14:26:59 -04:00
Rob Rix
ab6cb6c67b
Stream.rest does not force.
2015-09-17 14:26:25 -04:00
Rob Rix
d62d4a33bb
Don’t switch in uncons.
2015-09-17 14:23:51 -04:00
Rob Rix
ad835e6c9a
Add a case analysis method.
2015-09-17 14:23:33 -04:00
Rob Rix
a1136f8e58
rest forces.
2015-09-17 14:23:05 -04:00
Rob Rix
298c2accae
uncons does not force the remainder of the stream.
2015-09-17 14:22:05 -04:00
Rob Rix
b3c0e92d2a
Stream concatenation.
2015-09-17 14:14:01 -04:00
Rob Rix
587ffcbb24
Stream is NilLiteralConvertible.
2015-09-17 14:12:39 -04:00
Rob Rix
6e5c72098a
Memo is a functor.
2015-09-17 14:10:51 -04:00
Rob Rix
538bbf0c27
Extra line.
2015-09-17 09:07:27 -04:00
Rob Rix
911501c337
Diff is Comparable.
2015-09-16 15:47:03 -04:00
Rob Rix
f9023f88b7
Equality of empty diffs.
2015-09-16 15:46:45 -04:00
Rob Rix
d0d53d152a
Diff applications, abstractions, and groups as arrays.
2015-09-16 15:00:06 -04:00
Rob Rix
6a8915fc61
Approximate SES.
2015-09-16 14:58:53 -04:00
Rob Rix
d92afc817e
Make Cons indirect to work around a runtime deadlock.
2015-09-16 14:56:34 -04:00
Rob Rix
8618d7bbca
Insert/Delete convenience constructors.
2015-09-16 13:52:53 -04:00
Rob Rix
7e5100c813
Stream memoizes.
2015-09-16 13:44:02 -04:00
Rob Rix
71236c1b8d
Remove the autoclosure constructor.
2015-09-16 13:43:57 -04:00
Rob Rix
590a290c0a
Memo constructors.
2015-09-16 13:42:31 -04:00
Rob Rix
8c16f0321b
Add a Memo type.
2015-09-16 12:59:57 -04:00
Rob Rix
3bade61660
Stream is a SequenceType.
2015-09-16 12:28:45 -04:00
Rob Rix
9c47dae557
Stream.map.
2015-09-16 12:27:23 -04:00
Rob Rix
0dfd3a5ecd
Diffs have a magnitude.
2015-09-16 12:23:24 -04:00
Rob Rix
e823f84d4a
Syntax folding.
2015-09-16 12:22:53 -04:00
Rob Rix
53ce3368cc
Stream.isEmpty.
2015-09-16 11:56:06 -04:00
Rob Rix
fc7fa9db3b
Construct Streams with sequences, generators, and sources.
2015-09-16 11:54:19 -04:00
Rob Rix
bec4764a39
Stream unconsing.
2015-09-16 11:44:56 -04:00
Rob Rix
4aa5a86143
Basic Stream abstraction.
2015-09-16 11:42:49 -04:00
Rob Rix
65d8b04eb9
(Failing) test of non-empty/empty SES.
2015-09-16 10:04:30 -04:00
Rob Rix
8a2ff37cb9
(Failing) test of empty/non-empty terms.
2015-09-16 10:02:20 -04:00
Rob Rix
6e5aacc988
SES is over [Fix], not [Diff].
2015-09-16 09:59:13 -04:00
Rob Rix
1aed2f8949
Test that empty collections generate empty diffs.
2015-09-16 09:56:28 -04:00
Rob Rix
2fdff49711
Stub in SES.
2015-09-16 09:56:15 -04:00
Rob Rix
b0c396d734
Fix the copyright.
2015-09-15 15:23:07 -04:00
Rob Rix
440ccb9444
Leave Doc implicit wherever possible.
2015-09-15 14:33:09 -04:00
Rob Rix
8bf3464764
Test the production of copying diffs.
2015-09-15 14:29:54 -04:00
Rob Rix
02de7f075e
Add the sexpr grammar to the tests.
2015-09-15 14:28:32 -04:00
Rob Rix
29dcc19069
Remove the broken playground.
2015-09-15 14:27:18 -04:00
Rob Rix
9654536de1
Whatever you say, Xcode.
2015-09-15 14:26:25 -04:00
Rob Rix
5f464f3e10
🔥 Tree.
2015-09-15 14:17:40 -04:00
Rob Rix
bf10dfca2d
Diff.debugDescription gets the debug strings for its contents.
2015-09-15 14:09:45 -04:00
Rob Rix
d3b82148b8
Diff is CustomDebugStringConvertible.
2015-09-15 14:08:59 -04:00
Rob Rix
cae54e2c95
Fix can be empty.
2015-09-15 14:07:35 -04:00
Rob Rix
64c3a6074b
Don’t specialize description.
2015-09-15 13:58:47 -04:00
Rob Rix
d76ec6a208
Move Tree up in the list.
2015-09-15 13:56:08 -04:00
Rob Rix
9b9daa910a
Remove the heading.
2015-09-15 13:55:46 -04:00
Rob Rix
d5d63a892d
Define Doc directly, not algebraically.
2015-09-15 13:55:09 -04:00
Rob Rix
41bba38001
Fix is an enum.
2015-09-15 13:49:23 -04:00
Rob Rix
6724c834e5
Remove FixpointType.
2015-09-15 13:46:45 -04:00
Rob Rix
d23d646f66
Tree is CustomStringConvertible.
2015-09-15 12:52:07 -04:00
Rob Rix
5f66984cec
Tree is public.
2015-09-15 12:50:36 -04:00
Rob Rix
485565b4e4
Add a simple rose tree.
2015-09-15 12:49:39 -04:00
Rob Rix
871dc356dd
Tweak some things to make Xcode happy.
2015-09-15 12:34:53 -04:00
Rob Rix
93fd2acc81
Add 'prototype/' from commit 'a7fef6ced9d2b71dfdf5e6d8fb765ab0c0bc6be5'
...
git-subtree-dir: prototype
git-subtree-mainline: 0244ce39f68a04b515f32b2b8ea9a3e0228923c7
git-subtree-split: a7fef6ced9
2015-09-15 12:32:12 -04:00