Commit graph

27 commits

Author SHA1 Message Date
Agus Zubiaga
057a18573a
New module header
Implements the new `module` header syntax as described in "module and package changes" [1]:

```
module [Request, Response, req]
```

The old syntax should still work fine, and is automatically upgraded to the new one
when running `roc format`.

[1] https://docs.google.com/document/d/1E_77fO-44BtoBtXoVeWyGh1xN2KRTWTu8q6i25RNNx0/edit
2024-05-01 10:39:12 -03:00
Agus Zubiaga
d5a38a26db
Merge branch 'main' into inline-imports 2024-04-20 12:01:11 -03:00
Fabian Schmalzried
4269608ebf
remove i128OfDec 2024-04-01 21:08:12 +02:00
Richard Feldman
eb3dc3d582
Drop unused import in Hash.roc 2024-01-26 16:23:20 -05:00
Richard Feldman
502b0fddf2
Remove Nat from Hash, Inspect, Encode, Decode 2024-01-26 16:17:05 -05:00
Agus Zubiaga
7b3317dbb6
Update unused warnings for inline imports
Now that imports can be limited to smaller scopes than the entire module,
unused import warnings need to work like unused def warnings.

This commit moves unused import warnings discovery and reporting from load
to canonicalization where we can track their usage per scope.

This also fixes a longstanding bug where unused exposed names from an import
were not reported if they were only used in a qualified manner.
2024-01-20 08:43:36 -03:00
Agus Zubiaga
710d62f754
Load and can new top-level imports
Previously, all imports were available in the header, so we could start
processing dependencies as soon as we parsed it. However, the new imports
are treated as defs, so we have to parse the whole module to find them.

This commit essentially moves the dependency resolution from the `LoadHeader`
phase to the `Parse` phase, and it updates canonicalization to introduce
module symbols into scope when a `ValueDef::ModuleImport` is encountered.

NOTE:
- The `imports` header still parses, but it's no longer wired up. I will remove
it in an upcoming commit.
- Ingested files and imports that appear in nested expressions are not
yet supported by load
2024-01-20 08:39:31 -03:00
Richard Feldman
d41d976dac
Improve Hash.Hash docs a bit 2023-08-11 21:33:04 -04:00
Bryce Miller
cb08225bf0
| -> where 2023-06-05 20:19:00 -04:00
Bryce Miller
98338f6e20
has -> implements 2023-05-29 08:35:51 -04:00
Bryce Miller
ffa622e065
Merge branch 'main' into abilities-syntax
Signed-off-by: Bryce Miller <sandprickle@users.noreply.github.com>
2023-05-29 13:42:36 +02:00
Ayaz Hafiz
3585d5bb5b
Implement hash for Dec 2023-05-26 11:38:30 -05:00
Bryce Miller
55bb8f4b6c
fix typo 2023-05-24 10:53:13 -04:00
Bryce Miller
57c01de792
has [...] -> implements [...] 2023-05-24 10:36:18 -04:00
Bryce Miller
b1d592ec37
has clause -> implements clause 2023-05-20 07:15:30 -04:00
Ayaz Hafiz
f458da0cbc
Implement Hash for Bool 2023-03-28 15:04:45 -05:00
Brendan Hansknecht
6aec9cf058
add the ability to hash Nats 2022-12-05 16:00:56 -08:00
Ayaz Hafiz
f826ff1a71
Remove addI* variants from Hash
These are trivially fulfilled by converting a signed int to its unsigned
repr and hashing that.
2022-10-19 14:24:21 -05:00
Brendan Hansknecht
d87a750f7c
misc cleanup 2022-10-14 07:45:50 -07:00
Brendan Hansknecht
e937a9078c
add Hasher.reset and Hash.hashUnordered 2022-10-14 07:45:50 -07:00
Brendan Hansknecht
6445f26529
remove hashUnordered for now, needs more methods 2022-10-14 07:45:50 -07:00
Brendan Hansknecht
7a8dee888d
add hashUnordered that uses a walk method and hashes all elements 2022-10-14 07:45:50 -07:00
Brendan Hansknecht
f398bb1eff
switch hashStr to use addBytes 2022-10-14 07:45:49 -07:00
Ayaz Hafiz
5416eb7cbf
List dependencies in the stdlib explicitly rather than hard-coding 2022-10-05 18:53:49 -05:00
Ayaz Hafiz
5b833e57b5
Support derivation of Hash for Str and List 2022-10-04 14:09:40 -05:00
Ayaz Hafiz
f68cb3b0ed
Flip order of hash signature 2022-10-04 12:14:07 -05:00
Ayaz Hafiz
76510ec323
Add Hash.roc builtin module 2022-10-04 10:14:29 -05:00