Commit graph

201 commits

Author SHA1 Message Date
Folkert de Vries
86a1a0f401
Merge pull request #3643 from rtfeldman/disjoint-able-variable-specialization
Disjoint able variable specialization algorithm
2022-08-02 20:31:47 +02:00
Folkert de Vries
5061a67534
Merge pull request #3642 from rtfeldman/can-abilities6
Syntactic abilities: Part 6 - eager lambda set specialization, and fix ability let-generalization
2022-08-01 23:57:56 +02:00
Ayaz Hafiz
02d5d0ec92
Allow naming type variables with a basis hint
I think this makes it easier to read type variables when they come from
flex/rigid vars with pre-existing names, just give them a number suffix
to differentiate them.
2022-07-29 15:32:44 -04:00
Ayaz Hafiz
4657a957f7
When storing variables, merge them directly with the target rather than unifying
When we unify two variables that end up merged, the rank of the
resulting content is the lower of the two variables being merged. But
during storage, we really do mean, take the target descriptor of the
type we're merging against, and don't try to lower to a
possibly-generalized rank! This fixes a couple bugs I didn't even
realize were present!
2022-07-29 14:53:14 -04:00
Ayaz Hafiz
3b38228c36
Fix infer query indentation 2022-07-29 14:18:47 -04:00
Ayaz Hafiz
ff4b5f58ab
Avoid over-eager disjoint variable merging during lambda set compaction
During the unspecialized lambda set compaction procedure, we might end
up trying to merge too many disjoint variables during unspecialized
lambda unification. Avoid doing so, by checking if we're in the
compaction procedure.
2022-07-29 14:18:47 -04:00
Ayaz Hafiz
7926499900
Implement disjoint type variable handling in the lambda set specialization algorithm
This completes the last known hole I am aware of in the current
lambda set specialization algorithm.

Closes #3421
2022-07-29 14:18:46 -04:00
Ayaz Hafiz
1976e435a0
Turn a couple more solve tests back on 2022-07-29 08:43:19 -04:00
Ayaz Hafiz
41eb3ad9a4
Separate ability members and their specializations in reference checking 2022-07-29 08:43:19 -04:00
Ayaz Hafiz
f145f29b1b
Make sure records don't de-generalize function types, fixing ability let-generalization
Closes #3641
2022-07-29 08:43:19 -04:00
Ayaz Hafiz
ce8c8f7264
Update solve test
Use named recursive calls for now in ability members
2022-07-29 08:43:18 -04:00
Ayaz Hafiz
0989b2cb82
Move solve problems to their own crate 2022-07-28 08:57:32 -04:00
Ayaz Hafiz
28c1a4cb95
Use ImplKey in abilities store public API 2022-07-26 20:46:33 -04:00
Ayaz Hafiz
9a60f720d4
Add reproduction for recursive ability impl specialization with inference 2022-07-25 10:53:29 -04:00
Ayaz Hafiz
75ce40c67d
Make sure ability defs that are possibly recursive are marked as such 2022-07-25 10:52:55 -04:00
Ayaz Hafiz
cd0b8577ab
Have load_internal deal with separate declared/known ability specializations 2022-07-25 09:24:58 -04:00
Ayaz Hafiz
e2454f497f
Store declared implementations, both custom and derived, in abilities store 2022-07-25 09:09:01 -04:00
Ayaz Hafiz
c882c76685
Update test 2022-07-24 16:12:47 -04:00
Ayaz Hafiz
beccc92c87
Support underscores in assignment patterns 2022-07-24 16:11:03 -04:00
Ayaz Hafiz
d4cf9b8f8d
Apply is-open constraints to nested types
Closes #3459
2022-07-22 12:57:27 -04:00
Ayaz Hafiz
13b0ce7ca0
Make sure to apply "is-open" constraints at the very end of pattern constraining
Closes #3298
2022-07-22 12:57:27 -04:00
Ayaz Hafiz
613606a67d
Support inference options in solve tests 2022-07-22 12:57:26 -04:00
Ayaz Hafiz
7fbdbca4c6
Add multi-branch bound pattern solve test 2022-07-21 12:22:27 -04:00
Ayaz Hafiz
78dc82867a
Report errors for identifiers not bound in all patterns of a branch 2022-07-21 12:15:05 -04:00
Ayaz Hafiz
ce8b50caea
Support bound variables in multiple patterns 2022-07-21 11:40:09 -04:00
Ayaz Hafiz
bf8fc0d0de
Permit binding variables multiple itmes in when branches 2022-07-21 11:06:40 -04:00
Ayaz Hafiz
b4f45215ea
Fix solve tests 2022-07-19 15:02:52 -04:00
Ayaz Hafiz
d2da395619
Syntactic ability links in solve 2022-07-18 18:33:28 -04:00
Ayaz Hafiz
4d0c1e6a9c
Use insta for inferred queried tests 2022-07-18 17:55:02 -04:00
Ayaz Hafiz
17f53a23a5
Update tests 2022-07-18 17:55:02 -04:00
Richard Feldman
518b21c3f8
Rename Json.format to Json.toUtf8 2022-07-17 15:21:27 -04:00
Ayaz Hafiz
f1a6ea6a40
Typecheck and compile opaque wrapping functions
This enables you to write something like

```
A := U8
List.map [1, 2, 3] @A
```

which will be compiled as if it was `List.map [1, 2, 3] \x -> @A x`.

Closes #3499
2022-07-12 18:38:03 -04:00
Folkert de Vries
f1aae6f480
Merge pull request #3476 from rtfeldman/i3469
Remove more builtins code
2022-07-10 23:06:50 +02:00
Ayaz Hafiz
c211ec9790
Don't include DelayedAlias in illegal cycle checks 2022-07-10 13:53:41 -04:00
Ayaz Hafiz
98287e7670
Remove imported_builtins from load 2022-07-10 10:41:06 -04:00
Richard Feldman
c45e3ec4b4
Merge remote-tracking branch 'origin/trunk' into fix-nested-imports 2022-07-10 08:52:38 -04:00
Ayaz
7b308d9efe
Merge pull request #3404 from rtfeldman/ambient-lset-specialization
The ambient lambda set specialization algorithm
2022-07-09 17:23:27 -05:00
Richard Feldman
f45e3dbb46
Fix tests 2022-07-08 18:16:08 -04:00
Ayaz Hafiz
808d19b01b
Correctly compile unified recursive tag unions 2022-07-08 17:35:14 -04:00
Ayaz Hafiz
d9edb4d1bb
Support unification of recursion vars in opaques 2022-07-08 15:31:29 -04:00
Ayaz Hafiz
ebcd323449
Use strict unification of vars in unspecialized lambda sets right now 2022-07-06 13:08:58 -04:00
Ayaz Hafiz
0b427646e4
Continued progress on new lambda set compaction algorithm 2022-07-06 13:08:57 -04:00
Ayaz Hafiz
5534577a90
Embed new lambda set specialization algorithm 2022-07-06 13:08:56 -04:00
Ayaz Hafiz
c154a337a9
Get deep range numbers working 2022-07-05 22:16:52 -04:00
Ayaz Hafiz
fc1617bf17
Phantom types
Closes #3314
2022-07-05 19:07:41 -04:00
ayazhafiz
91050d9989
Add solve test for same layout different niche 2022-07-03 10:37:40 -04:00
ayazhafiz
ffa2ba1043
Fix solve tes 2022-07-03 10:37:28 -04:00
Ayaz Hafiz
28c1cf46a3
Multimorphic lambdas capture another lambda 2022-07-03 10:37:28 -04:00
Ayaz Hafiz
88618c098d
Unify lambda sets with left/right closure capture differences 2022-07-03 10:37:26 -04:00
Ayaz Hafiz
cecb6987e7
Admit duplicate lambdas in lambda sets when their captures don't unify 2022-07-03 10:37:25 -04:00