1
1
mirror of https://github.com/github/semantic.git synced 2024-12-23 06:41:45 +03:00
Commit Graph

263 Commits

Author SHA1 Message Date
Rob Rix
51d8fcd99a Match the parameters only once. 2016-07-08 12:14:42 -04:00
Rob Rix
6961a9ac9c Use wrap. 2016-07-08 12:14:21 -04:00
Rob Rix
e967668572 Require a Hashable instance for the leaf type. 2016-06-30 15:03:00 -04:00
Rob Rix
3cd2a4b82c Extract a function to select the category. 2016-06-30 14:24:59 -04:00
Rob Rix
d674dd06b6 Require the fields to have an Ord instance. 2016-06-30 12:59:56 -04:00
Rob Rix
6e1a7957ec Implement Recursive diffing pairwise over lists of inequal length. 2016-06-30 11:59:33 -04:00
Rob Rix
b5f9d94e80 Pass a getLabel function to rws. 2016-06-23 16:34:43 -04:00
Rob Rix
c1a2617fa1 Interpretation must operate over terms with extensible annotations. 2016-06-23 16:34:13 -04:00
Rob Rix
6c8ee2958a Rename a to leaf. 2016-06-23 10:23:27 -04:00
Rob Rix
2d709e1fc7 Add RWS operations. 2016-06-22 18:09:11 -04:00
Rob Rix
4d75f69e73 Reorder the comparable test before the equal terms test. 2016-06-03 16:37:09 -04:00
Rob Rix
ec84afcadb Compare terms sans annotations.
🎩 @rewinfrey.
2016-06-03 15:28:15 -04:00
Rob Rix
02d0cd1507 Generalize SES over term and edit type parameters. 2016-06-03 09:27:33 -04:00
Rob Rix
f39e3df33b Pass a DiffConstructor to diffTerms. 2016-06-03 02:59:48 -04:00
Rob Rix
6e256a53a5 Don’t bind variables we don’t use. 2016-06-03 02:44:12 -04:00
Rob Rix
0563bc58c1 Export the DiffConstructor type synonym. 2016-06-03 02:43:43 -04:00
Rob Rix
35327522b3 📝 DiffConstructor. 2016-06-03 02:42:27 -04:00
Rob Rix
9c07abcc07 Use a DiffConstructor to build diffs in constructAndRun & run. 2016-06-03 02:41:25 -04:00
Rob Rix
3e7784323f Stub in a DiffConstructor type synonym. 2016-06-03 02:41:01 -04:00
Rob Rix
43757e8a61 🔥 Categorizable.
This reverts commit be59b0c161362baae63308478177819828be7e1b.
2016-06-02 19:10:41 -04:00
joshvera
9ef2745944 Replace comparable with (==) category 2016-05-31 16:58:57 -04:00
Rob Rix
9e69f251b6 Annotate with an operator section. 2016-05-27 09:40:02 -04:00
Rob Rix
0850d91d50 Wrapping equal terms into diffs is really svelte now. 2016-05-27 09:38:54 -04:00
Rob Rix
de6d7edec2 Merge branch 'master' into cofree-and-bifunctors-sitting-in-a-tree-a-l-i-g-n-edly
# Conflicts:
#	semantic-diff.cabal
#	src/Alignment.hs
#	src/Control/Comonad/Cofree.hs
#	src/Data/Adjoined.hs
#	src/Diffing.hs
#	src/Interpreter.hs
#	src/Prologue.hs
#	src/Renderer/JSON.hs
#	src/Renderer/Patch.hs
#	src/Renderer/Split.hs
#	src/SplitDiff.hs
#	src/Term.hs
#	test/AlignmentSpec.hs
#	test/ArbitraryTerm.hs
#	test/PatchOutputSpec.hs
2016-05-27 09:35:26 -04:00
Rob Rix
cfe15a5afa Merge branch 'master' into cofree-and-bifunctors-sitting-in-a-tree-a-l-i-g-n-edly
# Conflicts:
#	src/Alignment.hs
#	src/Control/Comonad/Cofree.hs
#	src/Data/Adjoined.hs
#	src/Data/Align.hs
#	src/Data/Bifunctor/These.hs
#	src/Data/Coalescent.hs
#	src/Data/Copointed.hs
#	src/Data/Functor/Both.hs
#	src/Data/Option.hs
#	src/Line.hs
#	src/Patch.hs
#	src/Range.hs
#	src/Renderer/JSON.hs
#	src/Renderer/Patch.hs
#	src/Renderer/Split.hs
#	src/SplitDiff.hs
#	stack.yaml
#	test/AlignmentSpec.hs
#	test/CorpusSpec.hs
#	test/Data/Adjoined/Spec.hs
#	test/Data/Functor/Both/Spec.hs
2016-05-26 15:25:45 -04:00
joshvera
25be443f8a s/free . Pure/pure 2016-05-26 14:54:47 -04:00
joshvera
9d9fbe3c37 🔥 annotate and unfix 2016-05-26 14:46:13 -04:00
joshvera
ebd5d20171 Remove duplicate imports 2016-05-26 14:04:27 -04:00
joshvera
473ec980b1 Merge remote-tracking branch 'origin/master' into diff-summaries 2016-05-26 13:40:54 -04:00
joshvera
8180b37285 Use Protolude via the Prologue module and add NoImplicitPrelude 2016-05-26 12:58:04 -04:00
joshvera
48c7498ce2 Define Term in terms of Cofree 2016-05-04 14:37:24 -04:00
joshvera
9f8fc439b3 typealias Annotated to CofreeF 2016-05-03 14:19:10 -04:00
joshvera
6c07d4dc55 WIP CofreeF 2016-05-03 12:17:38 -04:00
Rob Rix
e3ace6408c Merge branch 'master' into cofree-and-bifunctors-sitting-in-a-tree-a-l-i-g-n-edly
# Conflicts:
#	test/AlignmentSpec.hs
#	test/PatchOutputSpec.hs
2016-04-14 12:57:45 -04:00
Rob Rix
a70981b2fb 📝 diffTerms’ cost parameter. 2016-04-12 18:00:50 -04:00
Rob Rix
4fb2c30892 Pass the cost function to interpret. 2016-04-11 14:49:25 -04:00
Rob Rix
60d6cfeb90 Use the curried both constructor. 2016-04-04 14:53:09 -04:00
Rob Rix
bf87e931b7 Move the annotated hylo from Interpreter into Term. 2016-03-18 12:43:29 -04:00
Rob Rix
379208b3a3 🔥 qualifications of zip & zipWith. 2016-03-11 14:21:42 -05:00
Rob Rix
a684c2fa58 Remove introduce. 2016-03-02 23:17:43 -05:00
Rob Rix
a2c0818851 Spacing. 2016-03-02 23:17:39 -05:00
Rob Rix
d7c42c2f2b Slightly more tacit implementation of introduce. 2016-03-02 23:17:18 -05:00
Rob Rix
1ececaa837 Remove eliminate. 2016-03-02 23:15:41 -05:00
Rob Rix
09c5dcfe4a Simplify the definition of eliminate. 2016-03-02 23:14:57 -05:00
Rob Rix
7d7c6efb65 Spacing. 2016-03-02 23:13:04 -05:00
Rob Rix
77ac8572ce Sort the imports. 2016-03-02 23:12:51 -05:00
Rob Rix
c889174aee Use Both to represent Diff annotations. 2016-02-29 10:12:34 -05:00
Matt Diephouse
170b7c6e1e Rename Categorizable module to Category 2016-02-04 13:59:33 -05:00
joshvera
724910bf7a Merge remote-tracking branch 'origin/master' into git-diff 2016-02-01 14:48:30 -05:00
joshvera
b188febbe7 share diff and breakDownLeavesByWord between SemanticDiff and Main 2016-01-20 11:36:06 -05:00
Matt Diephouse
3637bfee24 Document Interpreter.hs 2016-01-19 13:51:17 -05:00
Rob Rix
7af5a4876a Move OrderedMap into Data. 2016-01-06 11:56:58 -05:00
joshvera
6de9bbd1a7 Move Comparable and interpret to the top 2015-12-16 13:33:05 -05:00
Rob Rix
0908a4efd8 Inserted elements are inserted. 2015-12-15 12:42:50 -05:00
Rob Rix
b0739e53d1 Fewer parens. 2015-12-14 19:12:03 -05:00
Rob Rix
64b011e388 Diff Keyed nodes in order. 2015-12-14 19:11:40 -05:00
Rob Rix
d8dbfb15c5 Use Lists instead of Sets. 2015-12-14 19:10:17 -05:00
Rob Rix
9cc94ddf43 Compute the key/value pair for patched/equal elements. 2015-12-14 19:07:28 -05:00
Rob Rix
45ae975496 Compute the key/value pair for inserted elements. 2015-12-14 19:06:34 -05:00
Rob Rix
0d95b54f0f Compute the key/value pair for deleted elements. 2015-12-14 19:05:57 -05:00
Rob Rix
b2cbda1926 Extract the keys into the where clause. 2015-12-14 18:08:24 -05:00
Rob Rix
fbad8a45e3 Qualify the imports to make them easier to spot. 2015-12-14 18:06:56 -05:00
Rob Rix
ecb3e918f6 Use ! instead of lookup. 2015-12-14 18:05:00 -05:00
Rob Rix
62815448c1 Use OrderedMap everywhere. 2015-12-14 17:12:47 -05:00
Rob Rix
2170232547 Hide Prelude’s definition of lookup. 2015-12-11 17:19:14 -05:00
Rob Rix
defce6edbf Doc comments 🎩 @joshvera 2015-11-27 12:19:24 -05:00
Rob Rix
a2c994b573 Avoid some other shadowing. 2015-11-27 12:12:49 -05:00
Rob Rix
332f4c2ef2 Factor out the annotations. 2015-11-27 12:10:16 -05:00
Rob Rix
60961da561 We don’t use unwrap and we would otherwise shadow it. 2015-11-27 12:07:04 -05:00
Rob Rix
5aa8d4a3c0 Rename cost to diffCost. 2015-11-27 12:06:14 -05:00
Rob Rix
95750ea60d Use the factored-out annotations. 2015-11-27 11:46:25 -05:00
Rob Rix
f4c73cb3f7 Extract the annotation of Free terms. 2015-11-27 11:46:12 -05:00
Rob Rix
45a865698b Explicitly error if maybeInterpret’s assumptions are violated. 2015-11-27 10:04:53 -05:00
Rob Rix
edfc082a36 Single-line formatting. 2015-11-27 09:55:29 -05:00
Rob Rix
fe07b475e4 Use fromMaybe to unpack with a default value.
I was looking for exactly this! Very nice.
2015-11-27 09:53:37 -05:00
Rob Rix
982fe363d8 Sort imports. 2015-11-27 09:51:59 -05:00
Rob Rix
c925543305 constructAndRun for equal terms. 2015-11-19 11:56:45 -08:00
Rob Rix
87c7a0b6b0 Implement hylomorphism. 2015-11-19 11:56:35 -08:00
Rob Rix
6c6d72601d Factor out more annotation unpacking. 2015-11-19 11:37:19 -08:00
Rob Rix
c2dc659a57 Factor out annotation unpacking. 2015-11-19 11:36:14 -08:00
Rob Rix
e6385e2832 Diffs are annotated. 2015-11-19 11:27:31 -08: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
092192cb14 Short-circuit for equal terms. 2015-11-18 11:21:30 -08:00
Rob Rix
da5807180a If not comparable, don’t compare. 2015-11-18 11:13:13 -08:00
Rob Rix
6f49840fc8 Comparable tests terms. 2015-11-18 11:13:00 -08:00
Rob Rix
fc4cab8120 Export Comparable. 2015-11-18 11:09:18 -08:00
Rob Rix
0ad19372fd Parameterize interpret by a comparable function. 2015-11-18 11:09:11 -08:00
Rob Rix
6e64ada5ad Equal leaves produce equal diffs. 2015-11-18 10:59:40 -08:00
Rob Rix
7dae86cba6 Recursive for everything else. 2015-11-18 10:53:59 -08:00
Rob Rix
57e30d7a57 ByKey for Keyed nodes. 2015-11-18 10:52:49 -08:00
Rob Rix
dfbb01fda1 ByIndex for Indexed nodes. 2015-11-18 10:52:09 -08:00
Rob Rix
eeaa77812c Parameterize SES by the cost function. 2015-11-18 10:44:02 -08:00
Rob Rix
aabc5f62ee Compose. 2015-11-18 10:39:49 -08:00
Rob Rix
c2deb95a36 Recur through SES via constructAndRun. 2015-11-18 10:39:20 -08:00
Rob Rix
ae27e9cbbe Move SES into its own file. 2015-11-18 07:11:05 -08:00
Rob Rix
bb43da027a SES over empty/non-empty lists. 2015-11-18 07:02:47 -08:00
Rob Rix
a7545ed749 Interpret ByKey algorithms. 2015-11-18 00:21:27 -08:00
Rob Rix
da3bf047b1 Patch is algebraic. 2015-11-17 18:44:55 -08:00
Rob Rix
d881006e55 Spacing. 2015-11-17 18:26:07 -08:00
Rob Rix
e700c407f2 Move Patch into its file. 2015-11-17 18:23:53 -08:00
Rob Rix
ef1e64376c Break repacking out. 2015-11-17 18:16:39 -08:00
Rob Rix
a4f83780bd Factor some of the operands out. 2015-11-17 17:59:01 -08:00
Rob Rix
9504ebe586 Recursive interpretation of Keyed terms. 2015-11-17 17:50:15 -08:00
Rob Rix
0d8edc8272 Recur through Fixed terms. 2015-11-17 17:35:00 -08:00
Rob Rix
e26dbb1fbe Recur through indexed terms of equal length. 2015-11-17 17:34:04 -08:00
Rob Rix
e620eb76ff Stub in recurring through indexed terms. 2015-11-17 17:29:18 -08:00
Rob Rix
a30328e682 Stub in recursive diffing to always replace. 2015-11-17 17:29:12 -08:00
Rob Rix
485e947da6 Rename to constructAndRun. 2015-11-17 17:17:45 -08:00
Rob Rix
cdcb575b57 Only export interpret. 2015-11-17 17:15:10 -08:00
Rob Rix
16e4bf891d Interpretation. 2015-11-17 17:13:48 -08:00
Rob Rix
7c09fd1503 Stub in interpretation. 2015-11-17 17:05:16 -08:00
Rob Rix
b4450e038e Stub in a file for Interpreter. 2015-11-17 16:25:39 -08:00