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

387 Commits

Author SHA1 Message Date
Rob Rix
f81384767a
Reformat the signature for eval. 2019-07-18 22:00:45 -04:00
Rob Rix
01c963069e
Merge branch 'types-as-syntax' into gen-x 2019-07-18 21:37:07 -04:00
Rob Rix
4ccf31d863
Replace Substitutable with monadic substitution. 2019-07-18 17:01:03 -04:00
Rob Rix
fcaf1307dd
Replace FreeVariables with a function abstracted over a Foldable instance. 2019-07-18 16:53:00 -04:00
Rob Rix
e533091826
🔥 Gensym. 2019-07-18 16:39:23 -04:00
Rob Rix
cda5e3d80e
🔥 Namespaced. 2019-07-18 16:38:58 -04:00
Rob Rix
467292d509
🔥 Name. 2019-07-18 16:38:25 -04:00
Rob Rix
62c09c308b
🔥 Naming. 2019-07-18 16:37:51 -04:00
Rob Rix
59f09cc679
🔥 NamingC & runNaming. 2019-07-18 16:37:13 -04:00
Rob Rix
baa675f235
🔥 prime. 2019-07-18 16:35:57 -04:00
Rob Rix
03ed4cd3ae
Analyze with names in User. 2019-07-18 16:34:41 -04:00
Rob Rix
122b631811
Use Void to represent closed terms. 2019-07-18 16:19:05 -04:00
Rob Rix
5dbf727985
Generalize in pure code. 2019-07-18 16:10:16 -04:00
Rob Rix
a83cdffa73
Define a function to close a term. 2019-07-18 16:08:32 -04:00
Rob Rix
8371475e43
Use hoistTerm to generalize monotypes to polytypes. 2019-07-18 16:02:52 -04:00
Rob Rix
29fc72f288
Define a hoisting operation over Term. 2019-07-18 15:56:14 -04:00
Rob Rix
2388800416
🔥 the duplication between Monotype & Polytype. 2019-07-18 15:53:30 -04:00
Rob Rix
3e7123ff85
🔥 the M prefixes on Monotype’s constructors. 2019-07-18 15:48:24 -04:00
Rob Rix
b81cbf2686
Represent Monotype in Term. 2019-07-18 15:46:47 -04:00
Rob Rix
a5151d34e1
Derive Eq, Ord, & Show instances for Polytype. 2019-07-18 15:31:53 -04:00
Rob Rix
fcfc81606a
Derive some more instances for Monotype. 2019-07-18 15:26:13 -04:00
Rob Rix
c4fa4faf5c
🔥 PBound/PFree. 2019-07-18 15:24:43 -04:00
Rob Rix
7763028709
🔥 MFree. 2019-07-18 15:23:59 -04:00
Rob Rix
a9894d026e
Bind polytypes as scope-safe syntax. 2019-07-18 15:21:57 -04:00
Rob Rix
05a309745b
Tidy up the language extensions. 2019-07-18 14:45:30 -04:00
Rob Rix
70f67c0165
🔥 the Syntax class. 2019-07-18 14:44:36 -04:00
Rob Rix
2743895e78
🔥 the Syntax instance for Core. 2019-07-18 14:44:10 -04:00
Rob Rix
49baa468f9
🔥 iter. 2019-07-18 14:43:25 -04:00
Rob Rix
2f8126875d
Generalize stripAnnotations. 2019-07-18 14:41:04 -04:00
Rob Rix
9eae24ecc1
Recur through annotations. 2019-07-18 14:39:20 -04:00
Rob Rix
aa1e36bc93
Define stripAnnotations directly. 2019-07-18 14:37:19 -04:00
Rob Rix
97320176dc
🔥 interpret. 2019-07-18 14:34:44 -04:00
Rob Rix
4cbc23b76d
🔥 cata. 2019-07-18 14:34:16 -04:00
Rob Rix
e6e580d0a2
Spacing. 2019-07-18 14:30:20 -04:00
Rob Rix
fbb5688bd4
Use the top-level definition of with. 2019-07-18 14:29:57 -04:00
Rob Rix
d7e4f2129d
Combine prettyCore & prettify. 2019-07-18 14:28:12 -04:00
Rob Rix
4598da7e21
Define prettify direct-recursively.
This uses fromScope to recur, and accumulates a continuation for the variables to avoid n² fmaps.
2019-07-18 14:26:51 -04:00
Rob Rix
72701fe9fc
Reuse fromScope. 2019-07-18 11:02:56 -04:00
Rob Rix
e36cc7c184
Fix the doctest for concrete. 2019-07-18 10:25:43 -04:00
Rob Rix
325ec2a2c4
Sort the fixity declarations like in the syntax. 2019-07-17 15:29:40 -04:00
Rob Rix
d3cf5624e7
Give fixities for ... and .=. 2019-07-17 15:29:22 -04:00
Rob Rix
d9ea6e783e
Correct the precedences of pretty-printing for :. and :=. 2019-07-17 15:29:12 -04:00
Rob Rix
36827bb85c
Strip annotations in the tests. 2019-07-17 15:23:56 -04:00
Rob Rix
8aacefb5d1
Parse string literals. 2019-07-17 15:10:21 -04:00
Rob Rix
d076bbb21f
🔥 re-exports of iter & cata. 2019-07-17 14:54:29 -04:00
Rob Rix
1d94634cce
Generate User names. 2019-07-17 12:55:05 -04:00
Rob Rix
25f6f96ea4
Define a helper for constructing Named User. 2019-07-17 12:54:08 -04:00
Rob Rix
76f79fd315
Specialize pretty-printing to User. 2019-07-17 12:51:42 -04:00
Rob Rix
da85c697b2
Correct the types in the spec. 2019-07-17 12:44:34 -04:00
Rob Rix
c2812f8995
Fix up the generators. 2019-07-17 12:44:27 -04:00
Rob Rix
a1ee196d76
Define a helper to interpret a Term in some other eff-Carrier. 2019-07-17 11:57:44 -04:00
Rob Rix
1c85529a33
Move the fixities adjacent to Core. 2019-07-17 11:54:56 -04:00
Rob Rix
1e8a4ffa31
Replace Core with Term CoreF. 2019-07-17 11:53:20 -04:00
Rob Rix
1adc85d6a1
🔥 the Semigroup instance for Core. 2019-07-17 11:43:48 -04:00
Rob Rix
3e53644a36
Define block using a newtype helper.
We can’t rely on having a Semigroup instance for the term type.
2019-07-17 11:42:16 -04:00
Rob Rix
1e3e8dd425
Use the RightModule instance for CoreF to define the Monad instance for Core. 2019-07-17 11:24:57 -04:00
Rob Rix
e63e04724a
Define a RightModule instance for CoreF. 2019-07-17 11:24:44 -04:00
Rob Rix
d1c6d9fab8
Define a catamorphism over Terms. 2019-07-17 11:19:30 -04:00
Rob Rix
43061122b9
Define an iterator for Term. 2019-07-17 11:17:06 -04:00
Rob Rix
bb30733b83
Replace foldCoreF with a Syntax instance. 2019-07-17 11:15:24 -04:00
Rob Rix
7f828469c3
🔥 foldScope. 2019-07-17 11:14:46 -04:00
Rob Rix
7684e4c4cc
Define a Syntax instance for sums. 2019-07-17 11:13:36 -04:00
Rob Rix
f76f73cbeb
Define a Syntax instance for Scope. 2019-07-17 11:13:31 -04:00
Rob Rix
5f7f6c7982
Define a class of foldable Syntax types. 2019-07-17 11:12:34 -04:00
Rob Rix
2350792e23
Define a Carrier instance for Term. 2019-07-17 11:11:07 -04:00
Rob Rix
9d7b63c56e
Define Scope-compatible Eq & Ord instances for Term. 2019-07-17 11:10:24 -04:00
Rob Rix
8ca7382ab9
Define Applicative & Monad instances for Term. 2019-07-17 11:09:34 -04:00
Rob Rix
37b00e5a47
Derive Foldable, Functor, & Traversable instances for Term. 2019-07-17 11:09:04 -04:00
Rob Rix
168d0fa318
Define a Show instance for Term. 2019-07-17 11:06:57 -04:00
Rob Rix
a9508fa516
Define a Term datatype. 2019-07-17 11:05:50 -04:00
Rob Rix
3c664ece81
Stub in a module for a Term type. 2019-07-17 11:05:25 -04:00
Rob Rix
f72070d378
Define a RightModule instance. 2019-07-17 11:03:10 -04:00
Rob Rix
497e0dd226
Define a RightModule class & associated helpers. 2019-07-17 11:02:09 -04:00
Rob Rix
d211a10852
Stub in a module for modules over monads. 2019-07-17 11:00:32 -04:00
Rob Rix
4dd90b9083
Merge branch 'upgrade-to-fused-effects-0.5' into scope-safety 2019-07-15 16:28:23 -04:00
Rob Rix
157d931ad8
🔥 TransC. 2019-07-15 16:20:27 -04:00
Rob Rix
6fe74f012a
Use LiftC instead of TransC to define ReadlineC. 2019-07-15 16:20:07 -04:00
Rob Rix
ba8e03b111
Derive the HFunctor & Effect instances for Readline. 2019-07-15 16:12:47 -04:00
Rob Rix
b1fe3e6073
🔥 a bunch of redundant imports. 2019-07-15 15:23:29 -04:00
Rob Rix
7c4f35c1de
Generalize block. 2019-07-15 13:27:49 -04:00
Rob Rix
4863189099
Simplify the shape of Gensym. 2019-07-15 13:25:44 -04:00
Rob Rix
eacc890658
Rename the smart constructor to fresh. 2019-07-15 13:15:49 -04:00
Rob Rix
dc1a8144cd
Rename the Gensym constructor to Fresh. 2019-07-15 13:14:09 -04:00
Rob Rix
1f0428cc5b
🔥 //. 2019-07-15 13:12:27 -04:00
Rob Rix
2c10a9171c
Generalize all the smart constructors. 2019-07-15 13:04:47 -04:00
Rob Rix
c83d5f083e
Define a Carrier instance for Core. 2019-07-15 13:01:22 -04:00
Rob Rix
3e5d703263
Derive Generic1 & HFunctor instances for CoreF. 2019-07-15 13:01:07 -04:00
Rob Rix
5a0799f471
Define an HFunctor instance for Scope. 2019-07-15 13:00:22 -04:00
Rob Rix
e135751ecc
🔥 TransC. 2019-07-15 12:51:37 -04:00
Rob Rix
a69c34e57e
Bump semantic-core to fused-effects-0.5. 2019-07-15 12:48:13 -04:00
Rob Rix
9e4d91c688
Simplify the definition of block using the Maybe Monoid. 2019-07-15 10:56:53 -04:00
Rob Rix
9cf37ef4d0
Rename k to bound. 2019-07-15 10:53:15 -04:00
Rob Rix
82e779df29
Don’t label lambda-bound variables. 2019-07-15 10:52:45 -04:00
Rob Rix
b0776d4cbc
Spacing. 2019-07-15 10:50:45 -04:00
Rob Rix
6a237b7f41
Provide a bunch more Scope machinery. 2019-07-15 10:50:42 -04:00
Rob Rix
cf40f50459
Sort imports. 2019-07-15 10:48:37 -04:00
Rob Rix
f8b4375090
Move Incr & Scope into a new Data.Scope module. 2019-07-15 10:46:31 -04:00
Rob Rix
cecddcadd0
Stub in a Scope module. 2019-07-15 10:43:10 -04:00
Patrick Thomson
3438e476ea Fix effects in semantic-core. 2019-07-06 12:35:57 -04:00
Patrick Thomson
f401f75303 WIP 2019-07-06 10:52:38 -04:00
Rob Rix
50db4efa0c
Generalize runHeap over the name type. 2019-07-02 13:01:00 -04:00
Rob Rix
b7124e0c5b
Generalize FrameId over the name type. 2019-07-02 13:00:51 -04:00
Rob Rix
dee2a94e53
Generalize the flow-insensitive analysis over the name type. 2019-07-02 12:51:30 -04:00
Rob Rix
b2b7d77d51
Parse to Core User instead of Core Name. 2019-07-02 12:41:01 -04:00
Rob Rix
db2b72a133
Record user names in Core. 2019-07-02 12:39:58 -04:00
Rob Rix
da7fd48cff
Export Ignored. 2019-07-02 12:08:56 -04:00
Rob Rix
f0c08d8712
Factor the ignoring part of Named out. 2019-07-02 12:08:13 -04:00
Rob Rix
daa280c300
Define a helper to extract the User name from a Named value. 2019-07-02 12:07:28 -04:00
Rob Rix
906eba62f0
Give Named a parameter. 2019-07-02 12:02:04 -04:00
Rob Rix
48aad70f9f
📝 Named. 2019-07-02 11:58:39 -04:00
Rob Rix
e1158d89bc
Define a Named newtype. 2019-07-02 11:57:23 -04:00
Rob Rix
f9133f1325
Generalize instantiate. 2019-07-02 11:55:09 -04:00
Rob Rix
f68e7d76bf
Generalize bind. 2019-07-02 11:52:18 -04:00
Rob Rix
f2d3fee17c
Give Scope an extra parameter for binding sites. 2019-07-02 11:45:22 -04:00
Rob Rix
9af28f2f81
Give Incr an extra type parameter. 2019-07-02 11:41:32 -04:00
Rob Rix
1f23bfe83e
Extract a helper to fold within a CoreF. 2019-07-02 11:05:48 -04:00
Rob Rix
610f150da7
Move encloseIf into Data.Name. 2019-07-02 10:56:52 -04:00
Rob Rix
e07917555d
Note a FIXME. 2019-07-02 10:41:44 -04:00
Rob Rix
ddceb039d2
Simplify annWith. 2019-07-02 10:37:29 -04:00
Rob Rix
f3b4242ce5
🔥 the parameter to Root. 2019-07-02 10:31:47 -04:00
Rob Rix
4ed4df88c1
🔥 prettify'. 2019-07-02 10:20:55 -04:00
Rob Rix
fa8314d393
Simplify the handling of binders. 2019-07-02 10:20:07 -04:00
Rob Rix
085e4c288c
Redefine prettify as a CoreF-algebra. 2019-07-02 10:17:28 -04:00
Rob Rix
42f11aa8a8
Pass the Style into prettify. 2019-07-02 10:01:26 -04:00
Rob Rix
ce086a9ed1
cata takes a CoreF-algebra. 2019-07-02 09:55:15 -04:00
Rob Rix
7ca8693a87
Rename kfold to cata. 2019-07-02 09:48:20 -04:00
Rob Rix
200563a030
Redefine efold as iter, taking a CoreF-algebra. 2019-07-02 09:47:55 -04:00
Rob Rix
fc757694c8
Use Scope in Core. 2019-07-02 09:38:06 -04:00
Rob Rix
37be0183c3
Define a function for folding over scopes. 2019-07-02 09:37:24 -04:00
Rob Rix
7eff780174
Export Scope. 2019-07-02 09:37:00 -04:00
Rob Rix
a78bee5909
Define a MonadTrans instance for Scope. 2019-07-02 09:33:22 -04:00
Rob Rix
fc354b2039
Define a Monad instance for Scope. 2019-07-02 09:32:43 -04:00
Rob Rix
cd8f32f496
Define an Applicative instance for Scope. 2019-07-02 09:30:55 -04:00
Rob Rix
0290e9f7c3
Define a Monad instance for Incr. 2019-07-02 09:30:06 -04:00
Rob Rix
d0f9cbbc10
Define an Applicative instance for Incr. 2019-07-02 09:29:35 -04:00
Rob Rix
24cff39c17
Rename subst to fromIncr. 2019-07-02 09:28:41 -04:00
Rob Rix
0834d306e5
Redefine match to avoid an fmap. 2019-07-02 09:28:19 -04:00
Rob Rix
d1a3e6c845
Define a Scope newtype performing alpha-equivalent equality tests. 2019-07-02 09:27:22 -04:00
Rob Rix
283eb244cb
Split Core into functor & fixpoint once more. 2019-07-02 09:22:46 -04:00
Rob Rix
0b28f734a1
Simplify folds over Core to not require Coercible constraints. 2019-07-02 09:02:59 -04:00
Rob Rix
80cf7fde1c
🔥 a redundant import. 2019-07-02 09:02:26 -04:00
Rob Rix
0b3e5a44d8
🔥 Path names. 2019-06-28 14:22:32 -04:00
Rob Rix
8325e58413
🔥, 🔥, so much 🔥 2019-06-28 14:10:35 -04:00
Rob Rix
4b0b429ae7
Define efold without reference to eiter. 2019-06-28 14:08:45 -04:00
Rob Rix
67fd04f7d6
🔥 redundant parens. 2019-06-28 13:33:53 -04:00
Rob Rix
70890eaf9b
🔥 gfold. 2019-06-28 13:30:57 -04:00
Rob Rix
4b2c69d9bf
Define >>= using efold. 2019-06-28 13:30:36 -04:00
Rob Rix
30873a7762
Turn the wheel to maximum fastness. 2019-06-28 13:15:05 -04:00
Rob Rix
bc2c536822
Define kfold in terms of gfold. 2019-06-28 12:58:56 -04:00
Rob Rix
88ab103a23
Avoid an fmap. 2019-06-28 12:53:24 -04:00
Rob Rix
87ad03cc6e
Export incr after all. 2019-06-28 12:46:10 -04:00
Rob Rix
6d7520a0cd
Don’t export match, subst, or incr. 2019-06-28 12:26:30 -04:00
Rob Rix
de799f08b4
Generalize & move bind & instantiate. 2019-06-28 12:08:40 -04:00
Rob Rix
f0fae35ec9
Use separate functor & recursive types. 2019-06-28 11:41:53 -04:00
Rob Rix
a6cd4debe6
Annotate only the continuation. 2019-06-28 10:40:58 -04:00
Rob Rix
adddb87dc2
Rename n' to c. 2019-06-28 10:18:19 -04:00
Rob Rix
6dbb851b55
Define efold using eiter. 2019-06-28 10:00:04 -04:00
Rob Rix
501dd59329
Define efficient Mendler-style iteration of Core terms. 2019-06-28 09:57:40 -04:00
Rob Rix
0086d1e27b
Define an efficient generalized fold over Core. 2019-06-28 09:06:42 -04:00
Rob Rix
dc925fafcf
Fix indentation. 2019-06-27 19:21:45 -04:00
Rob Rix
746f0c92e9
Extract Var into Core. 2019-06-27 19:16:58 -04:00
Rob Rix
22c478bf45
🔥 >>> in favour of <>. 2019-06-27 15:26:30 -04:00
Rob Rix
383342bf9c
Use the smart constructor when binding. 2019-06-27 12:34:34 -04:00
Rob Rix
901e0172df
Add a smart constructor for string primitives. 2019-06-27 12:31:27 -04:00
Rob Rix
694bafed7e
🔥 konst. 2019-06-27 12:13:53 -04:00
Rob Rix
1f3cf601ad
🔥 unP. 2019-06-27 12:12:29 -04:00
Rob Rix
e776cd4051
Avoid a lambda. 2019-06-27 12:10:59 -04:00
Rob Rix
bc8937e60a
Simplify prettify' using kfold. 2019-06-27 12:09:39 -04:00
Rob Rix
1247dffb8b
Split Core into a higher-order functor and its fixpoint. 2019-06-27 12:02:56 -04:00
Rob Rix
2c8e8dcf3c
Use Const instead of K. 2019-06-27 09:40:08 -04:00
Rob Rix
03749a7ef4
Define a constant fold over core. 2019-06-27 09:37:36 -04:00
Rob Rix
3e6b41a2c1
Dedent. 2019-06-26 14:56:56 -04:00
Rob Rix
7e8c06a0d6
🔥 a type signature. 2019-06-26 14:56:00 -04:00
Rob Rix
ae2ae625e0
Zero-index. 2019-06-26 14:55:11 -04:00
Rob Rix
9c6d400224
🔥 P. 2019-06-26 14:53:41 -04:00
Rob Rix
44c0e8a38f
Don’t bother passing a Gensym around. 2019-06-26 14:49:28 -04:00
Rob Rix
babeeea738
Print variables more deliberately. 2019-06-26 14:38:48 -04:00
Rob Rix
da8de1b907
Define unP pointfully. 2019-06-26 14:13:33 -04:00
Rob Rix
b9f286bad4
Move unP next to p. 2019-06-26 14:12:11 -04:00
Rob Rix
da29ba1bea
Give a root name to prettify'. 2019-06-26 14:00:20 -04:00
Rob Rix
1eb9199c58
🔥 a redundant sig. 2019-06-26 10:49:57 -04:00
Rob Rix
8610f62707
Don’t print a name with lambdas, we’re using de Bruijn for this. 2019-06-26 10:43:55 -04:00
Rob Rix
d8a76ee1e2
Give an alternative definition of prettify using gfold. 2019-06-26 10:38:07 -04:00
Rob Rix
cea99d2aae
Specialize the type of the k parameter. 2019-06-26 10:07:07 -04:00
Rob Rix
6e5d4baa5f
Decompose sequences deeply. 2019-06-26 08:41:25 -04:00
Rob Rix
4b11270791
Decompose sequences. 2019-06-26 08:41:15 -04:00
Rob Rix
4c439f9ae7
Spacing. 2019-06-25 23:03:11 -04:00
Rob Rix
6dec2691da
Improve sharing. 2019-06-25 21:49:12 -04:00
Rob Rix
56336ae59a
Rename the dist parameter to k. 2019-06-25 21:42:35 -04:00
Rob Rix
8e000365a1
🔥 the dependency on recursion-schemes. 2019-06-25 21:31:25 -04:00
Rob Rix
df2355d277
Fix naming across the board. 2019-06-25 21:30:54 -04:00
Rob Rix
2ad9b569dd
Unpack lambdas. 2019-06-25 21:17:46 -04:00
Rob Rix
d9dd852738
Rename gfoldT to gfold. 2019-06-25 21:16:43 -04:00
Rob Rix
e73f8fe345
Pretty-print using the new shapes. 2019-06-25 18:33:06 -04:00
Rob Rix
9790468ada
Define instantiation of Core terms. 2019-06-25 18:31:28 -04:00
Rob Rix
bde447c040
Export lam. 2019-06-25 18:30:59 -04:00
Rob Rix
a2c4ddad34
Correct a comment. 2019-06-25 18:30:03 -04:00
Rob Rix
978f66aca6
🔥 the base functor. 2019-06-25 18:21:57 -04:00
Rob Rix
1240265cde
Make Core scope-safe. 2019-06-25 18:01:56 -04:00
Rob Rix
ba8de743a0
Beautify. 2019-06-25 17:47:31 -04:00