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

17307 Commits

Author SHA1 Message Date
Rob Rix
b541a973a4 appendGraph requires a Monad. 2018-10-18 08:20:36 -04:00
Rob Rix
c9e6912068 Port most of the system over to higher-order-effects. 2018-10-16 18:48:08 -04:00
Rob Rix
a66788c682 Only re-export Generic/Generic1. 2018-10-12 17:54:57 -04:00
Patrick Thomson
c4561184ff Merge branch 'master' into lts-upgrade-12.12 2018-10-09 16:31:05 -04:00
Patrick Thomson
989d38f27d Update to LTS 12.12.
The major bumps we get here are `algebraic-graphs` v0.2, which
contains a number of speed improvements, and the removal of the
`foundation` as a dependency.
2018-10-09 01:06:55 -04:00
Timothy Clem
ac70c565cc Change up what Declarations we identify 2018-10-05 09:54:57 -07:00
Patrick Thomson
d9c9e6838e Merge branch 'master' into fix-pretty-range-instance 2018-10-04 15:57:54 -04:00
Patrick Thomson
7746f7f006 Fix Range's Show instance to assuage the pretty-printer.
We use the `pretty-show` for pretty-printing Haskell values. This is a
convenient package in that it provides acceptably-good output without
having to define any extra instances of some `Pretty` class, and
we get nice colored output with `hscolour`.

It's not all skateboards and firecrackers, though. `pretty-show` uses
a predefined parser targeting the `Show` idioms in Haskell, and it
doesn't always do the thing we mean. For example, in #2192 we changed
the `Show` instance of `Range` to be a little more concise: a value of
shape `Range n m` is now printed as `[ n - m ]`. However, the
`pretty-show` parser sees that dash as Haskell's negate operator,
which is wrong, and leads to confused output from `ppShow` versus
`show`: the former prints out `[ n (-m) ]`, which is wrong.

There are three solutions we could pursue here, in increasing order of
practicality:

1. Dispense with `Show` entirely. There's an argument that we should
   never write our own `Show` instances, as this ensures that
   `read . show` is equivalent to `id`. If we want to examine values in
   the REPL, we should be using a `Pretty` typeclass from some
   library, and our `-interactive-print` function should operate on
   `Pretty` values rather than `Show`. This would mean we could elide
   a lot of generated `Show` instances, which is nice.
2. Keep our `Show` instances around, but move any custom
   instances to a `Pretty` class, and use a function that engages that
   class for our `-interactive-print` function.
3. Change the output of this `Show` instance to use something other
   than `-` for its separator.

Option 1 is the most principled, but also would require a lot of
legwork (though it might save us some compile time). Option 2 would be
more tolerable if we had `-XDerivingVia` or some easy way to use
`Show` as a `Pretty` instance. But both are unsatisfactory in light of
option 3, so I've changed the `-` to a `..`, which avoids all
lexer-related confusion.
2018-10-04 14:49:39 -04:00
Patrick Thomson
d56377aea9 Prevent slowdowns when pretty-printing in ghci.
Right now, when opening a shell with `script/ghci`, you can encounter
a tremendous slowdown by turning on pretty-printing (with `pretty`)
then printing any value (`[0..3]` should work).

This stems from the fact that our `.ghci` specifies the `prettyShow`
function, defined in Semantic.Util, as its `-interactive-print`
function. While this is a good choice of a pretty-printer, the fact
that it is in Util, a file which imports many modules and uses fancy
types, is not good: pretty-printing cannot begin until Util is
recompiled and linked in. This explains why benchmarking this slowdown
revealed nothing but `dlsym` calls: we thought it was due to linking
in the tree-sitter libraries, but it was actually waiting for Util to
compile and link in.

The fix is simple: define `prettyShow` in another module. This should
provide significant speedups to our developer workflow.
2018-10-04 14:38:36 -04:00
Charlie Somerville
a6138760a8 remove unused Subterm bits 2018-10-02 11:32:51 +10:00
Charlie Somerville
ef93c452c6 remove subtermValue and subtermAddress 2018-10-02 11:11:12 +10:00
Charlie Somerville
eda36d5331 remove collectingTerms 2018-10-02 11:05:40 +10:00
Charlie Somerville
db53ba16ec remove unused bits from Data.Algebra 2018-10-02 11:05:04 +10:00
Rob Rix
27861df507 🔥 a redundant constraint. 2018-09-27 13:45:27 -05:00
Rob Rix
5c2dac35e8 Merge branch 'master' into first-order-closures 2018-09-27 13:37:25 -05:00
Timothy Clem
35d77b505e Revert tableOfContentsBy removal of extra Maybe 2018-09-27 13:05:11 -05:00
Timothy Clem
6b40e59c1d No SplitDiff! 2018-09-27 13:04:51 -05:00
Rob Rix
40f47b45f0 Don’t shadow the name. 2018-09-27 13:03:50 -05:00
Rob Rix
e758b01725 🔥 a redundant TODO. 2018-09-27 13:02:50 -05:00
Timothy Clem
caf23dcf39 const is a bit nicer 2018-09-26 16:55:13 -05:00
Timothy Clem
f7e721a3a0 Slightly more elegant expression of mark 2018-09-26 16:55:02 -05:00
Timothy Clem
aa034e41bc Refactor back to just Range 2018-09-26 14:26:56 -05:00
Timothy Clem
d6302cd687 Cleanup 2018-09-26 14:25:00 -05:00
Timothy Clem
c8dfe57a48 Remove Data.Record entirely 2018-09-26 14:05:29 -05:00
Timothy Clem
fdc8d5210a Custom Show for Range and Span 2018-09-26 13:56:20 -05:00
Timothy Clem
1913277e74 Replace the annotation necessary for toc
Includes span in Declaration, refactors toc functions to remove a layer of maybe
2018-09-26 13:54:16 -05:00
Timothy Clem
f6f556fb32 TOC is the only thing with a custom annotation right now 2018-09-25 17:09:43 -05:00
Rob Rix
891f238179 Merge branch 'master' into first-order-closures 2018-09-25 16:53:41 -05:00
Timothy Clem
a6ad3f7f59 Reduce usage of DiffAnnotation 2018-09-25 16:52:40 -05:00
Rob Rix
29f6438609 🔥 a commented-out import. 2018-09-25 16:42:13 -05:00
Rob Rix
eb5a241edd Ignore a warning about reducing duplication. 2018-09-25 16:41:50 -05:00
Rob Rix
086b3b5624 🔥 some unnecessary language extensions. 2018-09-25 16:40:07 -05:00
Rob Rix
0653832d9d Swap the order of the parameters to Value. 2018-09-25 16:38:05 -05:00
Timothy Clem
f040234cf0 Don't need this 2018-09-25 16:06:02 -05:00
Timothy Clem
810d47300c Annoying that we always have to decorate here... 2018-09-25 15:59:09 -05:00
Timothy Clem
0a971c4ec8 Docs and a type synonym 2018-09-25 14:00:50 -05:00
Timothy Clem
eabd5b97e2 Minor refactor so we still get errors when we want that behavior 2018-09-25 14:00:39 -05:00
Rob Rix
06831f7f4d 🔥 some unused parametetrs. 2018-09-25 13:37:07 -05:00
Timothy Clem
14c175156d Decorator algebras in fully control of their return data 2018-09-25 12:04:25 -05:00
Timothy Clem
786acbdc6a Don't need any patterns here 2018-09-25 11:18:28 -05:00
Timothy Clem
0a837dfb97 Expose stripDiff 2018-09-25 11:18:10 -05:00
Timothy Clem
df7176e9a2 Don't need to know about Location here 2018-09-25 11:18:02 -05:00
Timothy Clem
9b641b4a4a The end of Record fields 2018-09-24 17:14:52 -05:00
Timothy Clem
38a4bb38f2 WIP - replace Record across the project
Not quiet there with Diff and decorators yet
2018-09-21 13:46:25 -07:00
Rob Rix
605687fe37 Define built-ins as part of the Function effect. 2018-09-21 16:21:27 -04:00
Rob Rix
c6769d2e01 Resume using a first-order definition of functions. 2018-09-21 14:42:57 -04:00
Timothy Clem
dfe8c842ed Term doesn't need to know about Record 2018-09-21 09:42:24 -07:00
Timothy Clem
faab30add2 Don't eagerly run while bodies 2018-09-21 09:14:07 -07:00
Rob Rix
98b1b1e16b 🔥 builtInExport. 2018-09-20 15:22:09 -04:00
Rob Rix
6993b39ab0 Define eval open-recursively. 2018-09-20 14:16:22 -04:00