1
1
mirror of https://github.com/github/semantic.git synced 2025-01-08 08:30:27 +03:00
Commit Graph

4708 Commits

Author SHA1 Message Date
Rob Rix
378acc4fc9 Define a Listable1 instance over Listable1 f => Cofree f. 2017-01-05 15:46:29 -05:00
Rob Rix
1cd0a540d4 Define a Listable2 instance over Listable1 f => CofreeF f. 2017-01-05 15:45:37 -05:00
Rob Rix
9a61258d3d Define a Listable instance over Listable a => DiffSummary a. 2017-01-05 15:41:30 -05:00
Rob Rix
78d1ec4da1 Define a Listable1 instance over DiffSummary. 2017-01-05 15:40:59 -05:00
Rob Rix
8d517541a0 Replace Category’s definition of ListableText. 2017-01-05 15:37:35 -05:00
Rob Rix
92e1fdf766 Define a Listable instance over ListableText.
This is fairly naïve, and should probably do something more like the Arbitrary instance in quickcheck-text:

http://hackage.haskell.org/package/quickcheck-text-0.1.2.1/docs/src/Test-QuickCheck-Utf8.html
2017-01-05 15:36:52 -05:00
Rob Rix
038b3605f1 Define a ListableText newtype. 2017-01-05 15:36:16 -05:00
Rob Rix
c8da9c5f31 Define a module for a Listable instance over Text. 2017-01-05 15:35:01 -05:00
Rob Rix
46c29feb45 Define a Listable2 instance over Either. 2017-01-05 15:33:51 -05:00
Rob Rix
66ed7316dd Define a Listable instance over Branch. 2017-01-05 15:30:21 -05:00
Rob Rix
33e6010e9c Define a Listable instance over Listable a => Gram a. 2017-01-05 15:28:15 -05:00
Rob Rix
a828467c58 Define a Listable1 instance over Gram. 2017-01-05 15:27:44 -05:00
Rob Rix
0331398deb Define a Listable2 instance over These. 2017-01-05 15:26:17 -05:00
Rob Rix
1dc26e985d Define a Listable1 instance over Joins of Listable2 bifunctors. 2017-01-05 15:24:56 -05:00
Rob Rix
c6b3025635 Define a Listable instance over Syntax leaf recur. 2017-01-05 15:22:56 -05:00
Rob Rix
7676e162cb Define a Listable1 instance over Listable leaf => Syntax leaf. 2017-01-05 15:22:49 -05:00
Rob Rix
15bc5d2cda Define a Listable2 instance over Syntax. 2017-01-05 15:22:29 -05:00
Rob Rix
6a1b6e7e76 Define a lifted cons over 4-ary constructors. 2017-01-05 15:22:11 -05:00
Rob Rix
b39a9c2d0e Define a Listable1 instance over []. 2017-01-05 15:11:05 -05:00
Rob Rix
d95077037e Define a Listable instance over Cost. 2017-01-05 15:04:42 -05:00
Rob Rix
d8058807f6 Define a Listable instance over non-empty Records. 2017-01-05 15:04:01 -05:00
Rob Rix
8949f8e7e0 Define a Listable instance over empty records. 2017-01-05 15:03:06 -05:00
Rob Rix
9b49fde245 Avoid exporting ListableText. 2017-01-05 15:01:34 -05:00
Rob Rix
5a6d8676cf Define a Listable instance over Category. 2017-01-05 14:59:55 -05:00
Rob Rix
c4c37914a0 Define a Listable newtype wrapping Text. 2017-01-05 14:59:39 -05:00
Rob Rix
d80ea55a59 Define a Listable instance over Patch. 2017-01-05 14:46:18 -05:00
Rob Rix
8c566860ee Define a Listable1 instance over Patch. 2017-01-05 14:45:56 -05:00
Rob Rix
9e486da785 Define a Listable instance over SourceSpan. 2017-01-05 14:44:22 -05:00
Rob Rix
3a7588ad1e Define a Listable instance over SourcePos. 2017-01-05 14:44:12 -05:00
Rob Rix
e1ee210468 Define a Listable instance over Range. 2017-01-05 14:42:57 -05:00
Rob Rix
6a2b1bf3a6 Define a Listable1 instance over Listable a => ((,) a). 2017-01-05 14:40:57 -05:00
Rob Rix
62eac61fe1 Define a Listable2 instance over (,). 2017-01-05 14:40:37 -05:00
Rob Rix
8d9562e94e Define a lifting of cons3. 2017-01-05 14:40:28 -05:00
Rob Rix
e5f4aed989 Define a lifting of cons2. 2017-01-05 14:40:16 -05:00
Rob Rix
fe6a0852c5 Lift Listable through Listable2. 2017-01-05 14:39:51 -05:00
Rob Rix
6db5cf152a Lift Listable over * -> * -> *. 2017-01-05 14:39:10 -05:00
Rob Rix
cae179abc2 Define a Listable1 instance over Maybe. 2017-01-05 14:38:45 -05:00
Rob Rix
1e57f7474b Define a lifting of cons1. 2017-01-05 14:38:31 -05:00
Rob Rix
f17fd281ab Lift Listable through Listable1. 2017-01-05 14:37:39 -05:00
Rob Rix
2d9f56f946 Lift Listable over * -> *. 2017-01-05 14:37:02 -05:00
Rob Rix
da422724b3 Re-export Listable & the tier operators. 2017-01-05 14:36:16 -05:00
Rob Rix
22248f26bf Stub in a Listable module. 2017-01-05 14:34:45 -05:00
Timothy Clem
efb505bc25 Only use qualified Data.Text 2016-12-13 08:14:18 -08:00
Timothy Clem
1a7e37408e Slightly nicer way to get vowels 2016-12-13 08:13:56 -08:00
Timothy Clem
489ed112a0 Match on Category instead of name and rework determiner logic 2016-12-12 17:40:28 -08:00
Timothy Clem
cd2fe4a681 Calculate determiner from following summary, not preceding patch 2016-12-12 15:27:09 -08:00
Timothy Clem
91721682a6 Give BEGIN/END their own Syntax 2016-12-12 15:26:26 -08:00
Timothy Clem
005a5f43d0 Parse BEGIN/END {} for Ruby 2016-12-12 13:41:55 -08:00
Timothy Clem
7fcc5ab88f Merge branch 'master' into ruby-parse-fixes 2016-12-12 09:15:01 -08:00
Timothy Clem
5b10012466 Parse Ruby scope operator 2016-12-12 08:30:43 -08:00
Timothy Clem
1741cef639 Parse Ruby range expressions 2016-12-11 08:36:26 -08:00
Timothy Clem
e9f8014e50 Add singleton_class category to Split 2016-12-09 16:15:49 -08:00
Timothy Clem
c9e1cfb9b2 Parse instance_variable as Identifier for now 2016-12-09 16:12:36 -08:00
Timothy Clem
526199c47d Parse pairs 2016-12-09 16:12:20 -08:00
Timothy Clem
7c9fc3e0c6 Parse singleton classes 2016-12-09 16:12:07 -08:00
Timothy Clem
616f7953a7 s/function call/method call 2016-12-09 16:10:56 -08:00
Timothy Clem
6dd7a994b6 Revert "Categorize ruby method calls as such"
This reverts commit b99a05f680abb19b819d55cb7d7c8a4da75f8cfd.
2016-12-09 15:51:08 -08:00
Timothy Clem
5db5376d93 Remove some unused imports 2016-12-09 14:52:36 -08:00
Timothy Clem
fcff364131 Remove old cata approach 2016-12-09 14:47:35 -08:00
Timothy Clem
d84537ec42 Add some style to these guards 2016-12-09 14:47:00 -08:00
Timothy Clem
df7e016c60 Collapse up parse to product json and sexp output 2016-12-09 14:32:22 -08:00
Timothy Clem
772265e0bb Rename s/test/sexpression 2016-12-09 11:42:32 -08:00
Timothy Clem
2ef173b934 Sexpr diffs show source spans and pad/indent properly 2016-12-09 11:30:41 -08:00
Timothy Clem
21aba52c7e Categorize ruby method calls as such 2016-12-09 11:29:39 -08:00
Timothy Clem
b16b8ecb87 Rework as top down recursion to print diff trees 2016-12-09 09:47:51 -08:00
Timothy Clem
bab1f677ff Hard wrap FDoc comments for readability 2016-12-09 08:33:34 -08:00
Timothy Clem
686b0dffff Add new sexp style test output for diffs 2016-12-09 08:31:13 -08:00
Timothy Clem
3b676d9f31 Play with a different parse output 2016-12-08 08:11:49 -08:00
joshvera
81e93c178c Update struct, dictionary, and array type mappings 2016-12-07 15:47:47 -05:00
joshvera
6eec2689e5 Map keyed_element to Pair 2016-12-07 15:38:05 -05:00
joshvera
b555baead6 Map const specs to var assignments 2016-12-07 15:37:51 -05:00
joshvera
19141c2610 Extract the termName from the type, otherwise from the term 2016-12-07 15:36:47 -05:00
joshvera
381453e3a7 Consider structs identifiable 2016-12-07 15:36:33 -05:00
Timothy Clem
aa26c5472e Properly parse classes (with new tree-sitter trees) 2016-12-07 10:45:55 -08:00
joshvera
076afb77ec update tests 2016-12-07 13:26:31 -05:00
joshvera
563652355d Add ArrayTy, DictionaryTy, StructTy, Struct 2016-12-06 16:09:04 -05:00
Timothy Clem
3e3ea818eb Move to where ConditionalOperator was 2016-12-06 12:47:16 -08:00
Timothy Clem
6e42369ffe Collapse up math assignment into operator assignment syntax 2016-12-06 12:36:56 -08:00
Timothy Clem
ec4db8d2da Fix duplicate import 2016-12-06 12:00:33 -08:00
Timothy Clem
85367c9312 Allow proper diffing of relational, bitwise and other operators in JavaScript
Fixes #771, a long standing issue in JavaScript diffing
2016-12-06 11:59:14 -08:00
Timothy Clem
3b3c6739f8 Accept all shapes of ruby operators 2016-12-06 11:56:42 -08:00
Timothy Clem
048ac119ed Remove need for Binary and Unary - just use operator instead. 2016-12-06 11:43:20 -08:00
Timothy Clem
97c17a1b5c Just moving operator_assignment around 2016-12-06 11:42:41 -08:00
Timothy Clem
907d9d6cff Update termConstruction for ruby with new unary and binary 2016-12-06 11:23:10 -08:00
Timothy Clem
5c0ee56565 Bring in new tree-sitter API to query all child nodes 2016-12-06 11:21:31 -08:00
Timothy Clem
bb17a32539 New rescue productions 2016-12-06 08:51:34 -08:00
Timothy Clem
b13262771a Fix up method calls and member_access (call) 2016-12-06 08:34:15 -08:00
Timothy Clem
73514388b6 self,nil,true,false all have productions now 2016-12-06 08:30:08 -08:00
Timothy Clem
bcfac758b6 Update lambda statements to single production 2016-12-06 08:20:27 -08:00
Timothy Clem
d7317e7360 Fix up Ruby case/when parsing 2016-12-06 08:14:23 -08:00
Rick Winfrey
171544de29 Merge branch 'master' into javascript-improvements 2016-12-05 18:07:51 -06:00
Timothy Clem
cbb9664d32 Rename a bunch of Ruby productions 2016-12-05 15:58:11 -08:00
Timothy Clem
2ee93b4525 New shape for yield statements 2016-12-05 15:56:18 -08:00
Timothy Clem
47402c7c8a New shape for return statements 2016-12-05 15:54:59 -08:00
joshvera
24b69f0dbd Expand call expressions to take more than one argument 2016-12-01 16:06:56 -05:00
joshvera
9cd616f7b3 Remove last from Prologue 2016-12-01 16:03:45 -05:00
joshvera
e9489780d6 Add support for float literals and var assignments 2016-12-01 15:33:37 -05:00
Rick Winfrey
a0fb4e75a7 Add Yield term constructor support for JavaScript 2016-11-30 15:56:57 -06:00
Rick Winfrey
859820cfb2 Added support for Continue statements in JavaScript 2016-11-30 15:40:06 -06:00
Rick Winfrey
9d65261669 Add Break support to DiffSummaries 2016-11-30 15:31:05 -06:00
Rick Winfrey
1329d6c763 Add Break Syntax constructor 2016-11-30 15:30:51 -06:00
Rick Winfrey
d32e94bab1 Add break to renderers 2016-11-30 15:30:39 -06:00
Rick Winfrey
215163767e Construct Break terms 2016-11-30 15:30:22 -06:00
Rick Winfrey
7a1d80e914 Add missing Break category 2016-11-30 15:30:11 -06:00
Rick Winfrey
b90bb8913b Add trailing statement support for new tree-sitter trailing productions 2016-11-30 15:27:43 -06:00
Josh Vera
80ca5d2068 Merge branch 'master' into formatting 2016-11-29 19:12:50 -05:00
Rick Winfrey
758b631ea7 Make function formatting consistent in Renderer.JSON.hs 2016-11-23 15:13:45 -06:00
Rick Winfrey
f9d2d2b71f Clean up HasField constraint to apply only to the SourceText TermDecorator 2016-11-23 13:43:37 -06:00
Rick Winfrey
ce70771084 Remove redundant import 2016-11-23 13:42:44 -06:00
Rick Winfrey
b86edc3a54 Add writeToOutput function (prints to standard out by default, or a file if specified) 2016-11-23 13:33:01 -06:00
Rick Winfrey
421da39ce7 Rewrite algebra as TermF -> ParseJSON 2016-11-23 13:32:25 -06:00
Rick Winfrey
32b323c892 🔥 dead code 2016-11-23 13:31:59 -06:00
Rick Winfrey
800f1b4c13 Use zipWithM (because Monad zippers are the best zippers) 2016-11-23 13:31:27 -06:00
Rick Winfrey
eb88b46d6f Formatting of ParseJSON data type 2016-11-23 13:30:15 -06:00
Rick Winfrey
a7e21d1ebb Don't encodePretty when constructing new Terms 2016-11-22 18:50:57 -06:00
Rick Winfrey
81079b1241 Remove functor from ParseJSON 2016-11-22 18:50:39 -06:00
Rick Winfrey
bab0debf6d Merge branch 'master' into parser-option 2016-11-22 15:19:30 -06:00
joshvera
4605197d20 Cover every case 2016-11-22 15:10:10 -05:00
Josh Vera
75daa6d42e Merge branch 'master' into go-parser 2016-11-22 14:07:33 -05:00
joshvera
ec1ebbbef5 format TypeAssertion and TypeConversion summaries better 2016-11-22 13:24:51 -05:00
joshvera
5a9f1dad1a formatting 2016-11-22 13:24:30 -05:00
joshvera
c434f79162 Merge remote-tracking branch 'origin/master' into go-parser 2016-11-22 11:30:48 -05:00
Rick Winfrey
e6d1c3e3ec s/suboject/value 2016-11-21 17:52:02 -06:00
Rick Winfrey
9c4046463f Remove equivalency comment 2016-11-21 17:51:14 -06:00
Rick Winfrey
96ad346784 Original value over subobject 2016-11-21 17:51:04 -06:00
Rick Winfrey
fede68ad6e Soft wrap rather than hard wrap 2016-11-21 17:49:45 -06:00
Rick Winfrey
a7f87e2594 Reword hylomorphism explanation 2016-11-21 17:48:38 -06:00
Rick Winfrey
578d38426c Better define hidden functor 2016-11-21 17:48:22 -06:00
Rick Winfrey
5b52870b35 Handle merge conflicts 2016-11-21 17:44:06 -06:00
joshvera
fbd87fc618 exhaust some cases 2016-11-21 16:20:55 -05:00
joshvera
2ea54313a4 Add type conversions 2016-11-21 15:44:31 -05:00
joshvera
83453dd54f Add type assertions 2016-11-21 15:27:06 -05:00
joshvera
6eb6f91227 Fixed node term names should be the sources of their children 2016-11-21 13:01:38 -05:00
joshvera
0a06cfebc5 Parse slice expressions 2016-11-21 12:23:05 -05:00
Rick Winfrey
4170137bf9 🔥 () 2016-11-21 10:47:14 -06:00
Rick Winfrey
bbdad9b2ae Add simple count example
- Shows how a fixed point functor works with a base functor in isolation
- Shows cata, ana, hylo and para examples
2016-11-21 10:47:02 -06:00
Rick Winfrey
2d0769d0e0 Update hylomorphism example to be more interesting 2016-11-20 12:58:14 -06:00
Rick Winfrey
e5f36bb29e 📝 anamorphism example with more detail 2016-11-20 12:54:33 -06:00
Rick Winfrey
6df195dfa0 📝 paramorphism operation and how the resulting structure is built 2016-11-20 12:32:12 -06:00
Rick Winfrey
91d9c05c52 Add paramorphism example 2016-11-18 17:12:26 -06:00
Rick Winfrey
6a77dbd868 🔥 whitespace 2016-11-18 17:12:10 -06:00
Rick Winfrey
29ed06ce9d Add hylomorphism example for Terms 2016-11-18 11:33:47 -06:00
Rick Winfrey
8b7966b6ce Comment formatting 2016-11-18 11:33:27 -06:00
Rick Winfrey
0a794439f7 Mappend values 2016-11-17 17:28:14 -06:00
Rick Winfrey
5bbccf1861 Add catamorphism example showing how to tear down terms into a list of String 2016-11-17 17:26:54 -06:00
Rick Winfrey
90ba2a73ab Add anamorphism example showing how to construct terms from strings 2016-11-17 17:26:32 -06:00
Rick Winfrey
c093eb6838 Formatting changes 2016-11-17 17:25:40 -06:00
Rick Winfrey
766a7236b8 Add catamorphism example 2016-11-17 16:17:45 -06:00
Rick Winfrey
ab4b56dcd8 Add FDoc.RecursionSchemes and anamorphism example 2016-11-17 16:17:09 -06:00
Rick Winfrey
154f88532e Add syntax functions for indexed terms in both Cofree and CofreeF shapes 2016-11-17 15:00:18 -06:00