Commit graph

212 commits

Author SHA1 Message Date
Ayaz Hafiz
7a4c57d3dc
Clippy 2022-07-29 08:43:19 -04:00
Ayaz Hafiz
4049eb6780
Remove unused OpportunisticResolve field 2022-07-29 08:43:19 -04:00
Ayaz Hafiz
31220d5598
Fix spelling 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
f2d4bf20ba
Collect awaited lambda set specializations to be solved when a specialization is known
Despite our best efforts, sometimes we still can't specialize lambda
sets on the fly, if a specialization lambda set's specialization type
isn't yet well-known! This commit adds an `AwaitingSpecializations`
data structure to keep track of the lambda sets blocked for
specialization behind a specialization's full resolution in the module.
After the specialization is resolved, its blocked lambda sets can be
eagerly compacted.
2022-07-29 08:43:18 -04:00
Ayaz Hafiz
350d9cd59b
Simplify opportunistic resolution
We don't need to unify the type state anymore because resolved able
variables are determined only by one type variable.
2022-07-29 08:43:18 -04:00
Ayaz Hafiz
76fe397aa1
Consolidate exposed types and derived module in a derived environment 2022-07-29 08:43:17 -04:00
Ayaz Hafiz
0ec92c12f7
Move lambda set specialization to its own module in solve 2022-07-29 08:43:16 -04:00
Ayaz Hafiz
c0e976f544
Wrap unification subs in Env 2022-07-28 08:57:33 -04:00
Ayaz Hafiz
0989b2cb82
Move solve problems to their own crate 2022-07-28 08:57:32 -04:00
Ayaz Hafiz
753d12e912
Eagerly resolve obligations during solving
Replaces the previously-used `DeferredObligations` structure used for
accumulating and then acting over ability obligations during module
solving in favor of just the `ObligationCache`. The `ObligationCache`
stays alive for the entirety of a module solving and provides a
convenient mechanism for answering obligation queries with a backed
cache.
2022-07-28 08:57:13 -04:00
Ayaz Hafiz
8659ddc684
Remove dominated derive errors 2022-07-26 20:46:35 -04:00
Ayaz Hafiz
ad3eb959e9
Don't mark dominated derives anymore 2022-07-26 20:46:34 -04:00
Ayaz Hafiz
04ee74542d
Rename IncompleteAbility 2022-07-26 20:46:34 -04:00
Ayaz Hafiz
c0d26226dd
Remove deferred obligation for opaques during solving 2022-07-26 20:46:34 -04:00
Ayaz Hafiz
c1dbffdad9
Make sure wrong specializations become error types 2022-07-26 20:46:34 -04:00
Ayaz Hafiz
3703940da9
Report specializations that target the unexpected type 2022-07-26 20:46:34 -04:00
Ayaz Hafiz
f2cf7405df
Revert "Use abilities ImplKey in solve"
This reverts commit b7cb0003134f1b0c657d7173db6965b4247500aa.
2022-07-26 20:46:33 -04:00
Ayaz Hafiz
254d684dfa
Use abilities ImplKey in solve 2022-07-26 20:46:33 -04:00
Ayaz Hafiz
28c1a4cb95
Use ImplKey in abilities store public API 2022-07-26 20:46:33 -04:00
Ayaz Hafiz
51bce825fb
Properly record all erroring ability implementations 2022-07-25 11:30:03 -04:00
Ayaz Hafiz
e2454f497f
Store declared implementations, both custom and derived, in abilities store 2022-07-25 09:09:01 -04:00
Folkert de Vries
860df057dc
Merge pull request #3600 from rtfeldman/i3298
Various improvements to is-open constraints/catch-all branches in patterns
2022-07-23 12:49:35 +02:00
Ayaz Hafiz
5ad04dcd2c
Emit runtime error when tag unions have an error type
Closes #3266
2022-07-22 15:46:09 -04:00
Ayaz Hafiz
d4cf9b8f8d
Apply is-open constraints to nested types
Closes #3459
2022-07-22 12:57:27 -04:00
Folkert de Vries
ca38ec4eb5
Merge pull request #3541 from rtfeldman/rocasync
Changes to get roc-async working
2022-07-18 19:22:07 +02:00
Ayaz Hafiz
eb2012dcad
Typos 2022-07-15 10:39:10 -04:00
Ayaz Hafiz
7b23077265
Treat numbers as ad-hoc types for the purpose of checking ability obligations 2022-07-15 10:39:09 -04:00
Ayaz Hafiz
c98ba441cf
Properly handle immediate derivations 2022-07-15 10:38:11 -04:00
Folkert de Vries
460b822caa
Merge pull request #3501 from rtfeldman/derive-tag-union-encoding-gen
Derive tag union encoding gen
2022-07-15 15:57:41 +02:00
Ayaz Hafiz
161c2101a7
Properly link lambda set variables in host exposed aliases 2022-07-14 12:20:39 -04:00
Folkert de Vries
1b1b63aad0
Merge branch 'trunk' into assoc-list-dict 2022-07-14 16:47:50 +02:00
Ayaz Hafiz
1cf1e114be
Derive tag union encoders 2022-07-14 08:49:45 -04:00
Folkert
88a9fab865
clippy 2022-07-14 08:56:23 +02:00
Ayaz Hafiz
71b078d2dc
Clone delayed type alias when there are equivalent type variables 2022-07-13 16:18:03 -04:00
Ayaz Hafiz
fe63140047
Clippy 2022-07-13 08:47:40 -04:00
Ayaz Hafiz
76f7843c93
Enforce some simplifications 2022-07-13 08:47:40 -04:00
Ayaz Hafiz
7ff180c1a5
Remove stale comments 2022-07-13 08:47:40 -04:00
Ayaz Hafiz
df9bcb1a0c
Use Derived_synth for synthesizing implementations, and Derived_gen for codegen 2022-07-13 08:47:39 -04:00
Ayaz Hafiz
63adb901b4
A couple hacks to get deriving of records working.. but it's working? 2022-07-13 08:47:38 -04:00
Ayaz Hafiz
719c774acf
Fix errors 2022-07-13 08:47:38 -04:00
Ayaz Hafiz
8d90f2c13e
Fix some compile errors 2022-07-13 08:47:38 -04:00
Ayaz Hafiz
91e3bfbd01
Fix tests 2022-07-13 08:47:38 -04:00
Ayaz Hafiz
9826253785
Deriving string encoders works 2022-07-13 08:47:37 -04:00
Ayaz Hafiz
445d922f3b
Compact lambda sets with structural derived ability impls 2022-07-13 08:47:37 -04:00
Ayaz Hafiz
d8bee6cd18
Perfom derives from global derives module, not just symbol table 2022-07-13 08:47:36 -04:00
Ayaz Hafiz
088b443e05
Refactor lambda set compaction so it's better split up 2022-07-13 08:47:35 -04:00
Folkert
f9d8e01561
implement Dict/Set completely in roc 2022-07-13 00:35:20 +02:00
ayazhafiz
699c4d7fff
Move Solved to roc_solve 2022-07-10 19:42:41 -04:00
Ayaz Hafiz
640ca78bc5
Simplify the lambda set instantiation process 2022-07-06 13:08:59 -04:00