1
1
mirror of https://github.com/github/semantic.git synced 2024-12-24 23:42:31 +03:00
Commit Graph

123 Commits

Author SHA1 Message Date
joshvera
48c7498ce2 Define Term in terms of Cofree 2016-05-04 14:37:24 -04:00
Matt Diephouse
b8c7aaeccd Document SES.hs 2016-01-21 10:29:52 -05:00
Rob Rix
f0b026f07f Revert "Diffs are Church-encoded."
This reverts commit 84e126cb18397fd85e7b12ee0ce2bbde770c4300.
2015-12-24 21:28:42 -05:00
Rob Rix
7695992f70 Diffs are Church-encoded. 2015-12-24 21:11:09 -05:00
Rob Rix
6be93fa749 Dollar sign spaceship operator to the rescue. 2015-12-24 01:10:17 -05:00
Rob Rix
671ecc2c11 Rejigger some parentheses to avoid a $. 2015-12-24 01:09:49 -05:00
Rob Rix
56aa250f96 Eta-reductions. 2015-12-24 01:09:40 -05:00
Rob Rix
d17a44221d Don’t re-sum the costs. 2015-12-24 01:08:53 -05:00
Rob Rix
dba213ebfc Remove an unnecessary $. 2015-12-24 01:08:23 -05:00
Rob Rix
6c2bde6bd0 Cache invalidation. 2015-11-30 18:25:59 -05:00
Rob Rix
6fd8ad90d5 SES calls into diffAt. 2015-11-30 18:17:30 -05:00
Rob Rix
149b80e1da Perform the diff in the general case. 2015-11-30 18:17:21 -05:00
Rob Rix
a76f645f63 Abstract over type parameters. 2015-11-30 18:17:15 -05:00
Rob Rix
b0762f5e5f Remove an unnecessary $. 2015-11-30 17:52:45 -05:00
Rob Rix
7ef0800b75 Remove the copy binding. 2015-11-30 17:50:23 -05:00
Rob Rix
56b4ae6ea3 Short-circuit at end of a/b attributes costs. 2015-11-30 17:47:32 -05:00
Rob Rix
4cd988b89b Delete/insert are consed with costs. 2015-11-30 17:47:10 -05:00
Rob Rix
f68d7c253a Compute cost and cons together edit scripts at once. 2015-11-30 17:37:13 -05:00
Rob Rix
827ae6374a Produce diff/cost pairs. 2015-11-30 17:28:02 -05:00
Rob Rix
b6251522a3 Add a function to compute a recursive copy. 2015-11-30 17:25:54 -05:00
Rob Rix
bf333bc073 Add delete & insert bindings. 2015-11-30 17:25:43 -05:00
Rob Rix
37f6c02432 Add a recur function closing over the operands. 2015-11-30 17:25:18 -05:00
Rob Rix
3f6caffb04 sumCost sums the cost fields. 2015-11-30 17:24:54 -05:00
Rob Rix
1d99c50a44 Add a best function. 2015-11-30 17:08:28 -05:00
Rob Rix
f511c85691 The indices come after the functions. 2015-11-30 17:08:08 -05:00
Rob Rix
ea6369bdb1 Parameterize by the comparison function. 2015-11-30 16:58:21 -05:00
Rob Rix
29475a1ef6 Bring the sumCost function over. 2015-11-30 16:57:23 -05:00
Rob Rix
e1cd992155 Parameterize by the cost function. 2015-11-30 16:57:14 -05:00
Rob Rix
f714539691 Rename the state variable. 2015-11-30 16:55:22 -05:00
Rob Rix
461c7629c9 We’re going to need these. 2015-11-30 16:54:51 -05:00
Rob Rix
1704369fdc We don’t use these bindings. 2015-11-30 16:53:04 -05:00
Rob Rix
b0b43cf3b0 Eliminate with pattern matching. 2015-11-30 16:51:45 -05:00
Rob Rix
6b61eb7777 Attempt to stub in computation of the rest of the diff. 2015-11-30 16:48:33 -05:00
Rob Rix
3429f52e3f Move the return inside the handling of the Just case. 2015-11-30 16:45:54 -05:00
Rob Rix
7793a8de2f Stub in caching & computation. 2015-11-30 16:44:41 -05:00
Rob Rix
f81de8d289 Get the state in the general case. 2015-11-30 16:25:00 -05:00
Rob Rix
47f3b61395 Diffing a non-empty list against an empty list produces deletions. 2015-11-30 16:23:34 -05:00
Rob Rix
0d2e881405 Diffing an empty list against a non-empty list produces insertions. 2015-11-30 16:21:41 -05:00
Rob Rix
df23b3af23 Diffing empty lists produces an empty diff. 2015-11-30 16:19:34 -05:00
Rob Rix
e4c7ce28c0 Remove needless parens. 2015-11-30 16:17:37 -05:00
Rob Rix
4a3c63473e Import Map qualified. 2015-11-30 16:17:24 -05:00
Rob Rix
efee13fd63 Stub in a diffAt function. 2015-11-30 16:02:37 -05:00
Rob Rix
2e307510b2 Don’t shadow the head function. 2015-11-27 12:03:48 -05:00
Rob Rix
dcd3fbdf8e We don’t need this import. 2015-11-27 12:03:19 -05:00
Rob Rix
3be2d11b13 Remove the delete/insert costs. 2015-11-27 09:49:51 -05:00
Rob Rix
062d54d731 Use a better name for the argument to sum. 2015-11-27 09:49:32 -05:00
Rob Rix
53e3928b3d Don’t close over the head of the list. 2015-11-27 09:46:51 -05:00
Rob Rix
1808f61221 Remove copyCost. 2015-11-27 09:46:38 -05:00
Rob Rix
3a52a5c2b6 Use minimumBy to implement the insert/delete choice too. 2015-11-27 09:45:23 -05:00
Rob Rix
63e3252129 Use minimumBy to implement the SES choice. 2015-11-27 09:44:49 -05:00
Rob Rix
ab05599dab Sort imports. 2015-11-27 09:44:29 -05:00
Rob Rix
d51c6ba618 s/recur/diffTerms/ 2015-11-25 09:40:45 -05:00
Rob Rix
680465dfbf Abstract Diff over an annotation type. 2015-11-18 13:23:47 -08:00
Rob Rix
a47ad36d98 Move the definition of Term into the Term module. 2015-11-18 11:28:16 -08:00
Rob Rix
eeaa77812c Parameterize SES by the cost function. 2015-11-18 10:44:02 -08:00
Rob Rix
9fd3be3408 Capture the copy cost as well. 2015-11-18 10:38:29 -08:00
Rob Rix
0799dfa51d Capture insert/delete costs. 2015-11-18 10:37:42 -08:00
Rob Rix
40588b9942 Guards. 2015-11-18 10:36:47 -08:00
Rob Rix
7e75c662dc Diagonals. 2015-11-18 10:36:19 -08:00
Rob Rix
ad0c9ca4b2 Alias the comparison function’s type. 2015-11-18 10:28:07 -08:00
Rob Rix
e7e2f280e1 Parameterize by recur. 2015-11-18 10:26:40 -08:00
Rob Rix
2b8e3c7dbf Specialize to Term/Diff. 2015-11-18 07:44:08 -08:00
Rob Rix
08ce71953e Implement cost. 2015-11-18 07:43:10 -08:00
Rob Rix
08f3d217c0 Implement SES in terms of cost and recur functions. 2015-11-18 07:40:54 -08:00
Rob Rix
6d6fbcf797 Go back to Diff SES. 2015-11-18 07:40:30 -08:00
Rob Rix
cb6eeff9e3 Only export ses. 2015-11-18 07:27:54 -08:00
Rob Rix
676ef16162 Implement the empty cases by pattern matching. 2015-11-18 07:27:19 -08:00
Rob Rix
13499cc520 Implement the equal head case of SES. 2015-11-18 07:26:24 -08:00
Rob Rix
9bafea4749 SES returns both terms. 2015-11-18 07:25:42 -08:00
Rob Rix
8b3c1aacfd SES returns Either. 2015-11-18 07:25:26 -08:00
Rob Rix
e742cf6859 Annotate the type of SES.
I’m not at all sure this is correct.
2015-11-18 07:13:55 -08:00
Rob Rix
ae27e9cbbe Move SES into its own file. 2015-11-18 07:11:05 -08:00
Rob Rix
b122712470 Add a file for SES. 2015-11-18 07:09:49 -08:00