1
1
mirror of https://github.com/github/semantic.git synced 2024-12-27 17:05:33 +03:00
Commit Graph

53 Commits

Author SHA1 Message Date
Patrick Thomson
9852155a77 Upgrade to LTS 13.0 and GHC 8.6.3.
Bumps most of our dependencies.

Code changes:
* algebraic-graphs-0.3 no longer provides a Foldable or Traversable
  implementation for `Graph`, so now neither does our `Graph` type.
* CMark parsing now uses safe rendering of raw HTML/URLs by default,
  so there is no reason to pass an `optSafe` anymore.
* algebraic-graphs now no longer requires an Eq constraint on the
  output type it generates, so we can ditch our Serializing.DOT
  module. (Andrey fixed this for us specifically!)
2018-12-29 14:02:24 -05:00
Patrick Thomson
cd05aaa7a5 add Data/Graph/Spec 2018-10-31 12:30:56 -04:00
Rob Rix
034e2469ff Bump higher-order-effects. 2018-10-22 10:26:15 -04:00
Rob Rix
3ef2efa73a Merge branch 'master' into higher-order-effects 2018-10-22 09:45:57 -04:00
Patrick Thomson
ac543651ee Add NFData instances to enable more accurate benchmarking.
Because we're getting serious about benchmarking in the run-up to
Windrose, it's time to bring in the `deepseq` package to ensure that
benchmarks can fully evaluate the result of a test case.

The `deepseq` package provides an `NFData` typeclass:

```
class NFData a where
  rnf :: a -> ()
```

Instances use the `seq` combinator to ensure that the argument to
`rnf` is fully evaluated, returning (). If there is a `Generic`
instance for `a`, the implementation can be omitted. This patch adds
NFData for every syntax node, graph vertex, environment data
structures, and exceptions. It is long, but the work is very
straightforward, so don't panick.

The benchmark suite (`stack bench`) now produces more accurate
results. The benchmarks previously mimicked `rnf` by calling `show` on
the result of an evaluation or graph construction; now that we have
actual `NFData` instances we can use the `nfIO` combinator from
criterion. This has sped up the evaluation benchmarks and reduced
their memory consumption, while it has slowed down the call graph
benchmarks, as those benchmarks weren't evaluating the whole of the
graph.

Unfortunately, this patch increases compile times, as we have to
derive a few more Generic instances. I wish this weren't the case, but
there's little we can do about it now. In the future I have some plans
for how to reduce compile time, and I bet that those gains will at
least nullify the speed hit from this patch.

Now that we have NFData instances for every data type, we can start
benchmarking assignments, in preparation for fixing #2205.

This patch also pulls in updates to `effects` and `fastsum` that add
appropriate NFData instances for the data they vend.
2018-10-17 14:08:47 -04:00
Rob Rix
c9e6912068 Port most of the system over to higher-order-effects. 2018-10-16 18:48:08 -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
4bcd440c98 Dial in id vs description a bit, fix embedding of span 2018-09-06 16:46:27 -07:00
Timothy Clem
f0d164f952 Rework control flow graph data types 2018-09-06 15:12:12 -07:00
Timothy Clem
e788ed9baa First pass at returning adjacency graphs (JSON) as an alternative to trees 2018-09-05 11:13:35 -07:00
Rob Rix
a236328056 Merge branch 'master' into higher-order-effects 2018-06-26 15:14:28 -04:00
Rob Rix
fbc4d3f2fb Test a cyclic graph.
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-06-25 16:11:36 -04:00
Rob Rix
4943a58d43 Test a diamond graph.
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-06-25 16:09:55 -04:00
Rob Rix
d346a36559 Add some more doctests.
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-06-25 16:07:54 -04:00
Rob Rix
e3b06dada8 Import the graph constructors unqualified.
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-06-25 16:06:08 -04:00
Rob Rix
c9d340affb Define topologicalSort using the depth-first algorithm.
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-06-25 15:55:49 -04:00
Rob Rix
abc872af86 Correct the docs for topologicalSort.
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
2018-06-25 15:52:27 -04:00
Rob Rix
1ac4b8d006 Inline the definitiion of edgeCountsByVertex. 2018-06-25 13:05:22 -04:00
Rob Rix
091a341de4 Test topological sort on a -> b -> c.
This test fails.
2018-06-25 13:02:49 -04:00
Rob Rix
2e3636c015 Test topological sort on a -> b. 2018-06-25 13:02:37 -04:00
Rob Rix
f451d2bacd 📝 topologicalSort. 2018-06-25 12:57:12 -04:00
Rob Rix
c3a0adafaa I guess this was literally backwards 2018-06-22 16:05:54 -04:00
Rob Rix
19e35b3f52 Derive a Monad instance for Graph. 2018-06-20 12:40:33 -04:00
Rob Rix
ffe84b1dd2 Derive an Alternative instance for Graph. 2018-06-20 12:40:16 -04:00
Rob Rix
d472adab2b Derive an Applicative instance for Graph. 2018-06-20 12:40:01 -04:00
Rob Rix
85311cd9a3 Sort and group by the out-edge count. 2018-06-20 12:28:16 -04:00
Rob Rix
16c21c9c7b Export EdgeCounts. 2018-06-20 12:28:09 -04:00
Rob Rix
3b4fc281a9 Generalize the group by functionality. 2018-06-20 12:27:42 -04:00
Rob Rix
4be53bc553 Compute both in- and out-edge counts. 2018-06-20 12:24:54 -04:00
Rob Rix
ba921bcdf4 Define a Monoid instance for EdgeCounts. 2018-06-20 12:21:48 -04:00
Rob Rix
64c0e24cc0 Define a Semigroup instance for EdgeCounts. 2018-06-20 12:21:12 -04:00
Rob Rix
251cacda79 Define an EdgeCounts datatype. 2018-06-20 12:20:26 -04:00
Rob Rix
5bfa7f6326 Simplify the topological sort by returning the map. 2018-06-19 12:57:59 -04:00
Rob Rix
3451a0c264 Get the vertices from the map. 2018-06-19 12:49:59 -04:00
Rob Rix
1bdb613edd Vertices are initially zero, rather than unset. 2018-06-19 12:49:51 -04:00
Rob Rix
6740542592 Move the graph operations into Data.Graph. 2018-06-18 09:34:21 -04:00
Rob Rix
ccbd880155 Re-export Lower in Prologue. 2018-06-15 11:41:15 -04:00
Rob Rix
3763f49eb8 Define toEncoding for Graph via a JSONEdge newtype. 2018-05-11 12:34:09 -04:00
Rob Rix
0287e7a36a Simplify the ToJSON instance. 2018-05-11 12:25:23 -04:00
Rob Rix
65259053f4 Define a ToJSON instance for Graph. 2018-05-11 12:22:11 -04:00
Rob Rix
38463e0712 Re-export the Lower typeclass. 2018-05-11 12:21:49 -04:00
Rob Rix
dbf4b59ba2 Define a Lower instance for Graph. 2018-05-11 12:15:28 -04:00
Rob Rix
84c69b038d 📝 Graph. 2018-05-11 12:12:23 -04:00
Rob Rix
742f3b2744 Spell the vertex type parameter out. 2018-05-11 12:12:05 -04:00
Rob Rix
6278126f6a Define an Ord instance. 2018-05-11 12:11:49 -04:00
Rob Rix
869b054f2b Define a Monoid instance. 2018-05-11 12:11:03 -04:00
Rob Rix
17a9b20222 Define a Semigroup instance. 2018-05-11 12:10:59 -04:00
Rob Rix
613a812cf0 Add a function to simplify graphs. 2018-05-11 12:10:27 -04:00
Rob Rix
ee8f2d1611 Re-export overlay/connect/vertex. 2018-05-11 12:09:37 -04:00
Rob Rix
23bf0d2402 Derive Graph & ToGraph instances. 2018-05-11 12:09:21 -04:00