Rob Rix
d70f95fa56
Don’t re-export Span/Pos.
2019-10-07 17:18:18 -04:00
Rob Rix
8f11c4dae3
🔥 some commented-out fields.
2019-10-07 17:16:37 -04:00
Rob Rix
0b642f579d
Use semantic-source’s definition of Span.
2019-10-07 17:16:01 -04:00
Rob Rix
b082341704
Depend on semantic-source.
2019-10-07 17:14:32 -04:00
Rob Rix
03b12f2900
Define as a newtype wrapper around Text.
2019-10-07 17:10:24 -04:00
Patrick Thomson
375c975338
Use compileCC to build a record of toplevel bindings.
2019-09-23 11:56:40 -04:00
Rob Rix
7d1567e70a
🔥 a bunch of redundant hidden imports.
2019-09-20 16:45:12 -04:00
Patrick Thomson
d9f88fc046
Add a CHECK-TREE directive and simplify esoteric jq tests.
...
Due to the problems outlined in #245 , the tests for return statements
were complicated and not testing useful properties. This patch adds a
new `CHECK-TREE` directive which lets you embed a Core expression
as a string, which is parsed and then compared against the result of
compiling the containing module.
2019-09-18 18:07:43 -04:00
Patrick Thomson
da5bb84b05
Remove tree-sitter dependency from semantic-core.
2019-09-18 13:49:04 -04:00
Patrick Thomson
302add6c5e
Define annWith with annAt.
2019-09-18 13:43:36 -04:00
Patrick Thomson
962cd5d5de
Restore spacing.
2019-09-18 13:43:31 -04:00
Patrick Thomson
4d21791ae4
Add Data.Core.annAt.
2019-09-18 11:51:31 -04:00
Patrick Thomson
60fa4c82ab
Add Data.Loc.fromTSSpan.
...
We'll probably change this so that Unmarshal can do this for us, but
this implementation will suffice for now.
2019-09-18 11:50:53 -04:00
Patrick Thomson
1c5ac83791
Corral orphan instances.
2019-08-27 11:27:53 -04:00
Patrick Thomson
811f693051
Use Analysis.ScopeGraph instead of my bad reimplementation
2019-08-16 15:54:17 -04:00
Patrick Thomson
90dd0b4d33
Trying to bring up this test harness
2019-08-16 12:34:56 -04:00
Rob Rix
d3726fa9e2
Merge branch 'scope-graphs' into re-name
2019-08-06 15:08:56 -04:00
Rob Rix
0515d7c11d
Let-bind the function extending each value in the cell.
2019-08-06 15:05:15 -04:00
Rob Rix
c30e5ff473
Merge branch 'master' into scope-graphs
2019-08-06 14:55:39 -04:00
Rob Rix
8ad510d274
Merge branch 'master' into generalize-analyses-over-the-term-type
2019-08-06 14:38:30 -04:00
Rob Rix
f0ab3f1c91
Merge branch 'master' into factor-annotations-out-of-core
2019-08-06 14:07:22 -04:00
Rob Rix
c2e620ac6f
Haddock doesn’t like this.
2019-08-06 13:52:32 -04:00
Rob Rix
8d08b1a26a
Merge branch 'master' into sequence-values-in-the-abstract-domain
2019-08-06 13:45:57 -04:00
Rob Rix
d600246663
📝 the Semigroup instance for Concrete.
2019-08-06 13:44:21 -04:00
Rob Rix
82cb7e49b0
📝 the Semigroup instance for Term Monotype a.
2019-08-06 13:43:37 -04:00
Rob Rix
559a7aa59c
📝 the Semigroup use.
2019-08-06 13:41:45 -04:00
Rob Rix
dbf894163a
Merge branch 'master' into sequence-values-in-the-abstract-domain
2019-08-06 13:37:20 -04:00
Rob Rix
5d47b21977
Merge branch 'master' into module-laws
2019-08-06 13:34:36 -04:00
Rob Rix
372ed98b5e
Avoid rolling our own string literal parser.
...
🎩 @patrickt .
2019-08-06 12:25:05 -04:00
Rob Rix
78bd32e0b0
Don’t prefix :<-.
2019-08-06 12:23:01 -04:00
Rob Rix
b80dd5381a
Pull the rhs into a where clause.
2019-08-06 12:18:34 -04:00
Rob Rix
28404ae11e
foldrWithKey.
...
🎩 @patrickt .
2019-08-06 12:12:11 -04:00
Rob Rix
dd6d9a0209
Type application.
2019-08-06 12:07:01 -04:00
Rob Rix
0d2f05a8c7
📝 the parameters to unprefixEither.
2019-08-06 12:05:22 -04:00
Rob Rix
7c686d1ccb
📝 unprefixEither.
2019-08-06 12:04:22 -04:00
Rob Rix
eb2ede6d1d
Subterm.
2019-08-06 12:02:47 -04:00
Rob Rix
e2ec37ebdb
📝 unprefix’s parameters.
2019-08-06 12:01:30 -04:00
Rob Rix
ab07e5a0d6
📝 unprefix’s purpose.
2019-08-06 11:59:20 -04:00
Rob Rix
7b0a4155da
📝 unprefix.
2019-08-06 11:57:10 -04:00
Rob Rix
93eba20619
Rename un/unEither to unprefix/unprefixEither.
2019-08-06 11:55:43 -04:00
Rob Rix
93eba1d946
📝 the practical takeaway.
2019-08-06 11:47:35 -04:00
Rob Rix
c09e465efb
📝 RightModule and its laws.
2019-08-06 11:40:15 -04:00
Rob Rix
f141319f84
Rename User to Name.
2019-08-06 11:18:54 -04:00
Rob Rix
901014d6ac
🔥 a redundant FIXME.
2019-07-30 09:38:09 -04:00
Rob Rix
e58dea96fb
Factor out how we extend bindings.
2019-07-30 09:21:03 -04:00
Rob Rix
100d6a18ff
Extend the scope graph on assignment.
2019-07-30 09:14:32 -04:00
Rob Rix
196f2bff17
Add declarations to records.
2019-07-29 16:16:46 -04:00
Rob Rix
a73b267ebd
Rename Entry to Decl.
2019-07-29 16:10:09 -04:00
Rob Rix
ed94104e27
Map entries to references.
2019-07-29 16:08:56 -04:00
Rob Rix
a4066b9df6
Construct scope graphs on deref.
2019-07-29 16:07:29 -04:00
Rob Rix
6cb9af299e
Correct the Monoid instance for ScopeGraph.
2019-07-29 15:51:52 -04:00
Rob Rix
3bf6cb61fd
Export ScopeGraph’s constructor & field.
2019-07-29 15:51:38 -04:00
Rob Rix
34da6ada5c
Rename a couple of copy-pasta’d variables.
2019-07-29 15:36:37 -04:00
Rob Rix
a04ccbb08c
Write record fields to the heap in the abstract analyses.
2019-07-29 13:33:07 -04:00
Rob Rix
c7bee13fd4
Generalize scopeGraph over the term type.
2019-07-29 13:22:18 -04:00
Rob Rix
3bafa9a8b3
Generalize runFile over the term type.
2019-07-29 13:21:29 -04:00
Rob Rix
4296244f9e
Merge branch 'generalize-analyses-over-the-term-type' into scope-graphs
2019-07-29 13:19:51 -04:00
Rob Rix
bd5aea62b3
Fix the doctests of the concrete analysis.
2019-07-29 13:04:15 -04:00
Rob Rix
0b86f913ee
Clean up some language extensions.
2019-07-29 12:59:29 -04:00
Rob Rix
e9853c1a3f
Avoid allocating a useless cell.
2019-07-29 12:58:20 -04:00
Rob Rix
2c28e536e9
🔥 the FrameId reader effect.
2019-07-29 12:57:44 -04:00
Rob Rix
15e5731d93
Generalize concrete over the term types.
2019-07-29 12:55:13 -04:00
Rob Rix
da0d780f81
Generalize runFile over the term type.
2019-07-29 12:54:01 -04:00
Rob Rix
d8175305da
Generalize addressStyle over the term type.
2019-07-29 12:38:10 -04:00
Rob Rix
bd8f0ca4c1
Generalize heapAddressGraph over the term type.
2019-07-29 12:37:54 -04:00
Rob Rix
a549039dd3
Generalize heapValueGraph over the term type.
2019-07-29 12:37:39 -04:00
Rob Rix
021350b6da
Generalize heapGraph over the term type.
2019-07-29 12:37:25 -04:00
Rob Rix
ea174b2144
Generalize runHeap over the term type.
2019-07-29 12:36:58 -04:00
Rob Rix
c3cf286d9d
Generalize EdgeType over the term type.
2019-07-29 12:36:44 -04:00
Rob Rix
1192971d38
Generalize concreteAnalysis over the term type.
2019-07-29 12:36:14 -04:00
Rob Rix
2dde20051e
Generalize lookupConcrete over the term type.
2019-07-29 12:35:59 -04:00
Rob Rix
2559f589a8
Generalize Heap over the term type.
2019-07-29 12:35:02 -04:00
Rob Rix
fde2a448d3
Abstract Concrete over the term type.
2019-07-29 12:34:04 -04:00
Rob Rix
4553d59faf
Generalize importGraph over the term type.
2019-07-29 12:31:52 -04:00
Rob Rix
b92611458e
Change the kind of the term field to *.
2019-07-29 12:30:38 -04:00
Rob Rix
8b8a33071e
Generalize runFile over the term type.
2019-07-29 12:28:18 -04:00
Rob Rix
e2875572b9
Generalize typecheckingFlowInsensitive over the term type.
2019-07-29 12:25:03 -04:00
Rob Rix
813cde359e
Reformat the signature for runFile to accommodate the evaluator.
2019-07-29 12:23:52 -04:00
Rob Rix
97ae6e9b21
Use a type synonym for types.
2019-07-29 12:23:07 -04:00
Rob Rix
6652520175
Reformat the signature for runFile.
2019-07-29 12:21:50 -04:00
Rob Rix
5c67ea0322
Reformat the signature for typecheckingFlowInsensitive.
2019-07-29 12:20:55 -04:00
Rob Rix
2666f6cbc8
Generalize runFile over the term type.
2019-07-29 12:20:25 -04:00
Rob Rix
99d9a8d94d
Parameterize runFile by the evaluator.
2019-07-29 12:19:10 -04:00
Rob Rix
7e7f33c6d1
Generalize importGraphAnalysis over the term type.
2019-07-29 12:15:22 -04:00
Rob Rix
e022b47eef
Reformat the signature for importGraph.
2019-07-29 12:14:31 -04:00
Rob Rix
3387eacf98
Abstract Value over the term type.
2019-07-29 12:14:07 -04:00
Rob Rix
54430ac56d
Abstract Semi over the term type.
2019-07-29 12:13:15 -04:00
Rob Rix
65e218417f
Import graphs don’t need to collect the set of addresses in scope when abstracting.
2019-07-29 12:11:54 -04:00
Rob Rix
9acaaaedc0
🔥 the parentAddr in ImportGraph.
2019-07-29 12:10:48 -04:00
Rob Rix
465319b8d4
Simplify deref for Typecheck & ImportGraph.
2019-07-29 12:08:16 -04:00
Rob Rix
104bdacaae
Generalize Analysis over the term type.
2019-07-29 12:03:12 -04:00
Rob Rix
c82623db36
Generalize cacheTerm over the term type.
2019-07-29 11:59:30 -04:00
Rob Rix
fdc20a4256
Generalize convergeTerm over the term type.
2019-07-29 11:58:44 -04:00
Rob Rix
05fa90ef84
Generalize the Cache type over the term type.
2019-07-29 11:58:02 -04:00
Rob Rix
7b6b6a4259
Generalize convergeTerm over the address type.
2019-07-29 11:54:57 -04:00
Rob Rix
56984fa7a6
Define Cache as a newtype.
2019-07-29 11:52:48 -04:00
Rob Rix
fcf654032c
Rename the name parameter to address.
2019-07-29 11:49:16 -04:00
Rob Rix
3119c222cb
Derive the Eq, Ord, & Show instances for Ann.
2019-07-29 11:29:47 -04:00
Rob Rix
5ec40693c3
Generalize the various example programs to arbitrary carriers for Core.
2019-07-29 11:28:30 -04:00
Rob Rix
604f1d97b7
Generalize the generators to arbitrary carriers for Core.
2019-07-29 11:24:31 -04:00
Rob Rix
4fdef93d72
Generalize the parser to arbitrary carriers for Core.
2019-07-29 11:24:22 -04:00
Rob Rix
e2db378be6
Fix the tests.
2019-07-29 11:18:19 -04:00
Rob Rix
e9b21f6ebf
Generate terms capable of annotation in the parser.
2019-07-29 11:18:15 -04:00
Rob Rix
01f1176348
Split out an Ann datatype representing locations.
2019-07-29 11:12:06 -04:00
Rob Rix
99a4f8ed5a
Write an empty scope graph into the heap during abstraction.
2019-07-26 15:45:52 -04:00
Rob Rix
16b1442b4b
Simplify deref slightly.
2019-07-26 15:35:43 -04:00
Rob Rix
0c106865f7
Record where names were bound.
2019-07-26 15:19:39 -04:00
Rob Rix
09f2362cd2
Abstract closures to their graphs.
2019-07-26 15:13:43 -04:00
Rob Rix
cb5b0fb2c4
Don’t allocate a pointless heap cell.
2019-07-25 13:28:02 -04:00
Rob Rix
b8f7bb06db
Don’t provide a current FrameId.
2019-07-25 13:11:07 -04:00
Rob Rix
3654aac2c8
🔥 the parent addr from the import & scope graph analyses.
2019-07-25 13:09:16 -04:00
Rob Rix
53e08b38ba
🔥 the specialization of String in the scope graph.
2019-07-25 13:03:05 -04:00
Rob Rix
f6cd84eba7
Merge branch 'sequence-values-in-the-abstract-domain' into scope-graphs
2019-07-25 12:57:07 -04:00
Rob Rix
0f34dcec45
Sequence values in the abstract domain.
2019-07-25 12:33:33 -04:00
Rob Rix
cd950fd6ec
Derive a Semigroup instance for Term Monotype a.
2019-07-25 12:33:13 -04:00
Rob Rix
7d9100f816
Derive a Semigroup instance for Concrete.
2019-07-25 12:33:00 -04:00
Rob Rix
fde3424c13
Dedent all the Analysis fields.
2019-07-25 12:32:47 -04:00
Rob Rix
057a4f8b5a
Copy in the import graph definition.
2019-07-25 09:31:36 -04:00
Rob Rix
5a40e01ff1
Derive Eq, Ord, & Show instances for Entry.
2019-07-25 09:30:15 -04:00
Rob Rix
8c59f9dc42
Only import the one symbol from Data.Text.
2019-07-25 09:30:02 -04:00
Rob Rix
455990dbc2
Change entrySymbol’s type to Text.
2019-07-24 08:07:35 -04:00
Rob Rix
a0bf65f43b
Move Edge into Concrete.
2019-07-23 16:11:04 -04:00
Rob Rix
7c24672921
Parse whitespace following string literals.
2019-07-23 15:53:18 -04:00
Rob Rix
41a31d1873
Simplify the projection rule.
2019-07-23 15:49:22 -04:00
Rob Rix
15430badec
Alignment.
2019-07-23 15:44:02 -04:00
Rob Rix
0254bc9895
Parse more escape sequences.
2019-07-23 15:43:25 -04:00
Rob Rix
f10cbb21b3
Generate string literals.
2019-07-23 15:43:11 -04:00
Rob Rix
3d65ae97ef
Sort the atoms.
2019-07-23 15:27:03 -04:00
Rob Rix
ac3f487703
Correct the precedence of load.
2019-07-23 15:24:19 -04:00
Rob Rix
3b6741456d
Rename edge to load.
2019-07-23 15:23:45 -04:00
Rob Rix
e4470bcbcc
Generate load instructions.
2019-07-23 15:23:26 -04:00
Rob Rix
0d530dc078
Sort the recursive generators.
2019-07-23 15:22:12 -04:00
Rob Rix
4bd2129511
Lower the precedence in lambda bodies.
2019-07-23 15:20:20 -04:00
Rob Rix
8e5c2163b8
Correct the precedence of recursive bindings.
2019-07-23 15:19:59 -04:00
Rob Rix
308066fbb1
Generate recursive bindings.
2019-07-23 15:18:04 -04:00
Rob Rix
e03236d301
Generate assignments.
2019-07-23 15:15:55 -04:00
Rob Rix
068941e3e1
Correct the precedence of if/then/else and lambda.
2019-07-23 15:12:41 -04:00
Rob Rix
9ccd11ef09
ifthenelse and lambda bind looser than assignment.
2019-07-23 15:10:51 -04:00
Rob Rix
08878f1a18
assign binds looser than application.
2019-07-23 15:07:21 -04:00
Rob Rix
59af553279
Recur via expr.
2019-07-23 15:05:46 -04:00
Rob Rix
d1671a6d7c
Rename prj to projection.
2019-07-23 15:02:24 -04:00
Rob Rix
b700740174
Split out a rule for application.
2019-07-23 15:02:05 -04:00
Rob Rix
b58ddb470b
Projections are lvalues.
2019-07-23 15:01:25 -04:00
Rob Rix
76eb3e2154
Pretty-print with mandatory precedence handling.
2019-07-23 15:00:32 -04:00
Rob Rix
5b682606bc
inParens wraps a Doc, not an action.
2019-07-23 12:34:10 -04:00
Rob Rix
99668a33a1
Don’t set the precedence recursively.
2019-07-23 12:31:35 -04:00
Rob Rix
edbea6991c
Indentation.
2019-07-23 12:27:24 -04:00
Rob Rix
56d40daef4
Rename with to withPrec.
2019-07-23 12:26:25 -04:00
Rob Rix
96127627f6
Define Prec as a newtype.
2019-07-23 12:24:45 -04:00
Rob Rix
3da182dcec
Comma-separate records.
2019-07-23 12:12:02 -04:00
Rob Rix
453b898581
Use colons to separate keys & values.
2019-07-23 12:10:24 -04:00
Rob Rix
47b43cf009
Don’t pad empty records.
2019-07-23 12:08:28 -04:00
Rob Rix
a96eadb620
Nest & align recursive bindings.
2019-07-23 12:07:08 -04:00
Rob Rix
b119712c53
Avoid redundant nesting of statements.
2019-07-23 12:03:19 -04:00
Rob Rix
6b250c723e
Pretty-print variables early.
2019-07-23 11:46:06 -04:00
Rob Rix
7b290632e5
🔥 bind.
2019-07-23 11:43:38 -04:00
Rob Rix
0045283378
Define unstatements using un.
2019-07-23 11:40:01 -04:00
Rob Rix
1e4315736f
Pass the index to un/unEither’s argument.
2019-07-23 11:38:48 -04:00
Rob Rix
6aa85afa76
Simplify un/unEither to not assume a Monad.
2019-07-23 11:37:38 -04:00
Rob Rix
fa9c991320
Define an eliminator for blocks of statements.
2019-07-23 11:30:14 -04:00
Rob Rix
6050b9594d
Define an eliminator for statements.
2019-07-23 11:18:21 -04:00
Rob Rix
16413e1e5b
Define a couple of functions for taking apart sequences of syntax.
2019-07-23 11:15:47 -04:00
Rob Rix
a63e7c3418
Clean up the language extensions in Data.Name.
2019-07-23 11:14:43 -04:00
Rob Rix
1caf99b0bf
Align.
2019-07-23 11:11:24 -04:00
Rob Rix
aa7f1fc6cc
Define a Bifunctor instance for :<-.
2019-07-23 11:10:49 -04:00
Rob Rix
b0ee9eeb80
Derive Foldable, Functor, & Traversable instances for :<-.
2019-07-23 11:10:04 -04:00
Rob Rix
4e98c0434b
Move the unseq/unseqs exports up.
2019-07-23 11:09:12 -04:00
Rob Rix
ed0231cdf2
Add an unbind eliminator for >>>=.
2019-07-23 11:08:55 -04:00
Rob Rix
9b3164a722
🔥 block.
2019-07-23 11:02:06 -04:00
Rob Rix
50f9b82ae6
Nest sequences.
2019-07-23 11:01:25 -04:00
Rob Rix
390b25a894
Wrap & indent records.
2019-07-23 09:56:00 -04:00
Rob Rix
f1c4d8a1c5
Add spaces inside records’ braces.
2019-07-23 09:54:08 -04:00
Rob Rix
77acb91a7f
Add spaces inside braces.
2019-07-23 09:53:13 -04:00
Rob Rix
5c033abb3e
🔥 encloseIf.
2019-07-23 09:51:52 -04:00
Rob Rix
200bf17d27
Print spaces after semicolons.
2019-07-23 09:47:24 -04:00
Rob Rix
024d2d4072
Don’t qualify the Pretty import.
2019-07-23 09:44:12 -04:00
Rob Rix
09fdb30653
Alignment.
2019-07-23 09:43:27 -04:00
Rob Rix
f851b2bc92
Correct a bunch of precedences.
2019-07-23 09:40:56 -04:00
Rob Rix
0cb3f181d0
Indentation.
2019-07-23 09:40:47 -04:00
Rob Rix
a5ac6f3342
Correct the condition on parenthesization.
2019-07-23 09:40:27 -04:00
Rob Rix
344b5bded1
Projection binds tighter than application.
2019-07-22 16:26:41 -04:00
Rob Rix
45723e71fc
Simplify the pretty-printing of sequences with a helper.
2019-07-22 16:19:22 -04:00
Rob Rix
539f8db2f6
Test roundtripping of general expressions.
2019-07-22 15:42:08 -04:00
Rob Rix
b43bdbb353
Use named' to define the name generator.
2019-07-22 15:33:47 -04:00
Rob Rix
043d3083fa
Generate records.
2019-07-22 15:26:02 -04:00
Rob Rix
52da8b764c
Qualify the import of Data.Core.
2019-07-22 15:13:14 -04:00
Rob Rix
f9eea3892a
Print braces around nested binds.
2019-07-22 15:07:35 -04:00
Rob Rix
a77ecdbe78
Parse binding statements.
2019-07-22 15:04:46 -04:00
Rob Rix
a39e7730ea
Follow the do' model for the Ruby prelude.
2019-07-22 15:02:10 -04:00
Rob Rix
b8bcad0126
Use do' instead of block.
2019-07-22 14:53:54 -04:00
Rob Rix
1ce4153148
do' doesn’t take an explicit body.
2019-07-22 14:52:54 -04:00
Rob Rix
0797316ead
Rename binds to do'.
2019-07-22 14:43:56 -04:00
Rob Rix
724ae1763f
Allow binds to process non-binding statements.
2019-07-22 14:42:46 -04:00
Rob Rix
a25d971250
Better pretty-printing of parse errors.
2019-07-22 14:32:05 -04:00
Rob Rix
ed94f7e5c3
Fix the expectation for projections.
2019-07-22 14:27:03 -04:00
Rob Rix
95226623bf
🔥 redundant specs.
2019-07-22 14:26:49 -04:00
Rob Rix
45a3d6f0c1
Fix the generators.
2019-07-22 14:24:40 -04:00
Rob Rix
325dc9d8a2
🔥 some redundant FIXMEs.
2019-07-22 14:19:17 -04:00
Rob Rix
69b21510b2
Implement typechecking for records.
2019-07-22 13:38:02 -04:00
Rob Rix
0c80fd246c
Set the super field.
2019-07-22 13:32:52 -04:00