Commit graph

189 commits

Author SHA1 Message Date
Folkert
4cd8f0a056 clippy --fix fixes 2023-04-21 12:05:51 +02:00
Ayaz Hafiz
e5b619780c
Unnecessary return 2023-04-10 16:36:45 -05:00
Ayaz Hafiz
b9ab93fd98
Introduce annotation in first step of recursive solving independently
The algorithm for solving recursive definitions proceeds in several
steps. There are three main phases: introduction of what's known,
solving what's not known, and then checking our work of what was
inferred against what the programmer claimed. Concretely:

1. All explicitly-annotated signatures in the mutually recursive set are
   introduced and let-generalized.
2. Then, inference type variables (`_`) and unannotated def signatures are
   introduced to the cycle, without generalization. The bodies of these
   defs, that are either unannotated or have inference variables, are
   solved.
3. The defs from step (2) are now let-generalized, since we now know
   that their types are consistent. At this point, all the defs in the
   cycle have their types introduced and let-generalized, but we still
   haven't checked the bodies of the defs froom step (1).
4. Check the bodies of explicitly-annotated defs in recursive set. This
   might materially affect the actual types in the signature, for
   example do to fixpoint-fixing or alias expansion.
5. As a result of (4) possibly changing the structure of the annotated
   type, and because the previous annotated types in (1) were introduced
   at a lower rank, we now re-introduce and re-generalize the solved def
   types, in the same we did in step (3).
5. The rest of the program is solved.

Now, a very important thing here is that the annotation signature
introduced for (1) consists of different type variables than the
annotation signature introduced in (5). The reason is that they live at
different ranks. Prior to this patch we were not explicilty doing so;
this commit ensures that we do.
2023-04-10 16:31:00 -05:00
Ayaz Hafiz
352345d1d9
Refactor expr constraining to align with top-level constraining 2023-04-10 15:46:15 -05:00
Ayaz Hafiz
7fa508b3c8
Refactor headers_from_annotation to match over TypeTag 2023-04-10 15:44:11 -05:00
Brendan Hansknecht
6302a8d4b5
switch from type annotation to type variable 2023-04-09 14:03:33 -07:00
Brendan Hansknecht
ff414610ca
clippy
add basic test case for now in helloworld

reset helloworld back to original example

reset helloworld back to original example
2023-04-09 14:03:32 -07:00
Brendan Hansknecht
08179d2a65
make errors more correct and check for utf8 bytes 2023-04-09 14:03:32 -07:00
Brendan Hansknecht
07eb3614ea
get ingesting working both for Str and List U8 2023-04-09 14:03:32 -07:00
Brendan Hansknecht
d42aa43b41
add ingest file to can ir and start pipelining it through the compiler 2023-04-09 14:03:32 -07:00
Brendan Hansknecht
f42f61e271
run a toml formatter and then clean it up a bit 2023-03-06 19:47:57 -08:00
Brendan Hansknecht
4a89bee0a5
centralize package versions except for vendor and excluded 2023-03-06 19:29:09 -08:00
Brendan Hansknecht
5485c8a5b0
update to using workspace package spec 2023-03-06 16:36:18 -08:00
Brendan Hansknecht
c9e4badd93
update as many dependencies as possible to use the workspace version of the package 2023-03-06 12:43:48 -08:00
Joshua Warner
5a6be05ead
implement mono / lowering for tuples 2023-02-07 18:54:50 -08:00
Folkert de Vries
7aaf0f3822
Merge pull request #4916 from roc-lang/rust1_65
upgrade to rust 1.65 and clippy fixes
2023-01-24 14:14:10 +01:00
Joshua Warner
de828416bf
Initial implementation of tuples in type checking
This leaves in place a bunch of TODOs and likely many bugs - notably, I haven't tested codegen/layout at all here.
2023-01-22 12:40:44 -08:00
Anton-4
f00a9b1748
Merge branch 'main' into rust1_65
Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>
2023-01-17 20:14:44 +01:00
Ayaz
ed7123ed5b
Merge pull request #4887 from roc-lang/weakening-5
Finish weakening let-bindings
2023-01-17 12:47:12 -06:00
Anton-4
35b93f0d1e
use new name for clippy error 2023-01-17 18:19:17 +01:00
Anton-4
bbf35af8fa
Merge branch 'main' into rust1_65
Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>
2023-01-17 18:14:30 +01:00
Anton-4
a97c53d7ca
1.65 changes and clippy fixes 2023-01-17 18:09:16 +01:00
Ayaz Hafiz
5fceb9ceb7
Push implicit openness vars through 2023-01-16 10:52:23 -06:00
Ayaz Hafiz
95dae5036a
Weaken top-level mutually recursive let bindings as appropriate 2023-01-16 10:49:17 -06:00
Ayaz Hafiz
a77f04cd19
Weaken mutually-recursive let bindings as appropriate 2023-01-16 10:49:17 -06:00
Ayaz Hafiz
58081ada19
Weaken aliased variable names 2023-01-16 10:49:17 -06:00
Ayaz Hafiz
c3f1646274
Weaken ability members behind let-bindings 2023-01-16 10:49:17 -06:00
Ayaz Hafiz
48049ed956
Weaken tags behind let bindings 2023-01-16 10:49:17 -06:00
Ayaz Hafiz
52c2f3a054
Weaken zero-argument tags in let bindings 2023-01-16 10:49:16 -06:00
Ayaz Hafiz
d9da945283
Allow generalization of annotations with no implementation 2023-01-14 15:33:54 +01:00
Ayaz Hafiz
ab796d93ff
Format 2023-01-14 15:33:54 +01:00
Ayaz Hafiz
df90baa0fc
Weaken runtime errors 2023-01-14 15:33:53 +01:00
Ayaz Hafiz
e525726be6
Weaken typed holes 2023-01-14 15:33:53 +01:00
Ayaz Hafiz
20b4f290ce
Weaken expect/dbg behind let bindings 2023-01-14 15:33:53 +01:00
Ayaz Hafiz
354765afca
Explain why opaque wrap functions need not be weakened behind lets 2023-01-14 15:33:52 +01:00
Ayaz Hafiz
6dca92e420
Weaken record updates behind let bindings 2023-01-14 15:33:52 +01:00
Ayaz Hafiz
2e36e2f418
Don't weaken accessor functions
Accessor functions are equivalent to closures and hence obey function
semantics, no need to weaken them
2023-01-14 15:33:52 +01:00
Ayaz Hafiz
0a9155d9d8
Weaken record accesses 2023-01-14 15:33:51 +01:00
Ayaz Hafiz
b5cce17822
Weaken crash 2023-01-14 15:33:51 +01:00
Ayaz Hafiz
b8712bcb30
Weaken records in let-bindings
This change also means we must update the interface of `Dict.empty` and
`Set.empty` from

```
Dict.empty : Dict k v
```

to

```
Dict.empty : {} -> Dict k v
```
2023-01-14 15:33:51 +01:00
Ayaz Hafiz
61ac9bf9b2
Weaken binding empty records 2023-01-14 15:33:50 +01:00
Ayaz Hafiz
64f979a826
Weaken foreign calls 2023-01-14 15:33:50 +01:00
Ayaz Hafiz
b3acbdfdfd
Weaken run-low-level 2023-01-14 15:33:50 +01:00
Ayaz Hafiz
cb1373a3a4
Weaken let-binding calls 2023-01-14 15:33:49 +01:00
Ayaz Hafiz
d27a72de1f
Weaken let sequences under let binding 2023-01-14 15:33:49 +01:00
Ayaz Hafiz
e36f90feec
Weaken recursive let bindings 2023-01-14 15:33:49 +01:00
Ayaz Hafiz
2e41b59af4
Format 2023-01-12 10:02:21 -06:00
Ayaz Hafiz
04cf7e070d
Weaken let-bindings to if expressions 2023-01-12 10:02:21 -06:00
Ayaz Hafiz
9462f44bb7
Weaken variables bound to when expressions 2023-01-12 10:02:21 -06:00
Ayaz Hafiz
a2f04d1fa3
Weaken single quotes 2023-01-12 10:02:21 -06:00