Commit graph

331 commits

Author SHA1 Message Date
Ayaz Hafiz
a96225e92e
Store specialized variable for use in dbg as fake symbol in lowlevel call 2022-12-14 17:00:37 -06:00
Brendan Hansknecht
6aec9cf058
add the ability to hash Nats 2022-12-05 16:00:56 -08:00
Brendan Hansknecht
cad7d8b4e9
add walkUntil and use it to implement set equality 2022-12-03 13:17:35 -08:00
Brendan Hansknecht
cb08dca6f1
Add an indexmap like dict to roc 2022-12-03 13:17:34 -08:00
Folkert
e7f3c6f281
inline dbg 2022-11-23 21:23:28 +01:00
Folkert
662bf1de99
more workspace dependencies 2022-11-13 16:10:02 +01:00
Folkert
e92ceb7282
Mutex::new() is now const 2022-11-09 17:51:43 +01:00
Luke Boswell
2c2a70b8e7 Merge remote-tracking branch 'upstream/main' into rust-docs 2022-11-06 09:15:57 +11:00
Ayaz
0b6b16563f
Merge pull request #4451 from roc-lang/fix-mono-tests
Consolidate mono test behavior in debug and release modes
2022-11-03 22:11:43 -05:00
Folkert
66a1ba00eb
1.65 clippy fixes 2022-11-03 16:20:37 +01:00
Luke Boswell
a3f901427a
correct formatting and removed duplicate image 2022-11-03 20:02:10 +11:00
Luke Boswell
f3bdb5f321
updating rust package documentation 2022-11-03 20:00:06 +11:00
Ayaz Hafiz
204ac2f8b4
Consolidate mono test behavior in debug and release modes
Makes sure that we turn on `debug-symbols` in mono tests, and that this
feature is fully respected in symbol generation, so that output in
release + debug builds are the same.

Closes #4435
2022-11-02 15:04:47 -05:00
Ayaz Hafiz
e08b613047
Add Decode.mapResult 2022-10-23 20:48:06 -05:00
Richard Feldman
f734cc11c2
Merge pull request #4364 from travisstaloch/str-graphemes
Str graphemes
2022-10-22 22:31:50 -07:00
Prajwal S N
df7e4eea7e
builtin(str): implement Str.graphemes
Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
2022-10-22 19:29:49 -07: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
Prajwal S N
07224e9086
builtin(list): add List.walkFrom, List.walkFromUntil
Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
2022-10-17 20:51:03 +05:30
Ayaz Hafiz
12ecdab4c5
Add listGetUnsafe to Dict.roc rather than exposing from list 2022-10-14 13:43:31 -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
Ayaz Hafiz
595433b8c8
Make sure to map structuralNotEq to NotEq 2022-10-12 16:38:37 -05:00
Ayaz Hafiz
6149c289fc
Update Eq symbols 2022-10-12 16:38:36 -05:00
Ayaz Hafiz
3192bed417
Make sure structuralEq, structuralNotEq is not importable 2022-10-12 16:38:36 -05:00
Ayaz Hafiz
fe9b848686
Mark structuralEq as not exposed on the surface 2022-10-12 16:38:36 -05:00
Ayaz Hafiz
b04d7a9471
Bind types passed to isNotEq to Eq 2022-10-12 16:38:36 -05:00
Ayaz Hafiz
a256947a9f
Move Eq to Bool 2022-10-12 16:37:51 -05:00
Ayaz Hafiz
3674f6861e
Compile derived structural equality 2022-10-12 16:37:49 -05:00
Ayaz Hafiz
b587bcf0c2
Implement obligation checking for the Eq ability
Every type can have `Eq.isEq` derived for it, as long as

- it does not transitively contain a function
- it does not transitively contain a floating point value
- it does not transitively contain an opaque type that does not support
  `Eq`
2022-10-12 16:37:49 -05:00
Ayaz Hafiz
16d12a51c2
Add Eq to the standard library 2022-10-12 16:37:48 -05:00
Prajwal S N
a3e6345257
builtin(list): add List.countIf
Closes #4174

Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
2022-10-13 00:45:13 +05:30
Ayaz
83b64c4fb3
Merge pull request #4209 from roc-lang/impl-tag-discriminant
Derive `Hash` implementations for tag unions
2022-10-10 22:23:05 -05:00
Richard Feldman
860d8b41f1
Merge pull request #4273 from cjduncana/dict-update
Add the `update` function to the `Dict` module
2022-10-10 02:37:42 -07:00
Christopher Duncan
96e12aa790
Add the update function to the Dict module
This resolves #4239
2022-10-09 20:21:21 -04:00
Prajwal S N
aef15ac1e8
Merge branch 'main' into str-withprefix 2022-10-09 15:53:16 +05:30
Richard Feldman
8b3d73dfbc
Merge pull request #4249 from snprajwal/list-walkBckwardsUntil
builtin(list): implement List.walkBackwardsUntil
2022-10-08 23:47:29 -07:00
Ayaz
9d05bcd9d8
Merge pull request #4237 from snprajwal/str-withcapacity
builtin(str): implement Str.withCapacity
2022-10-08 14:31:30 -05:00
Anton-4
54fb1bc32f
Merge remote-tracking branch 'upstream/main' into str-withprefix 2022-10-08 19:58:51 +02:00
Prajwal S N
cbceeff902
builtin(list): implement List.walkBackwardsUntil
Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
2022-10-08 14:23:06 +05:30
Prajwal S N
d6526fa425
builtin(str): add withPrefix
Closes #4142

Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
2022-10-08 12:52:10 +05:30
Prajwal S N
9013e4ce11
builtin(str): implement withCapacity
Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
2022-10-08 00:24:46 +05:30
Prajwal S N
0f96dddc25
builtin(list): expose walkTry
Fixes: #4168

Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
2022-10-07 00:03:18 +05:30
Ayaz Hafiz
792afe5457
Remove TagDiscriminant low-level 2022-10-05 13:00:45 -05:00
Ayaz Hafiz
fd54cdfdd1
Low-level to extract discriminant from a tag union 2022-10-04 16:17:05 -05:00
Ayaz Hafiz
5b833e57b5
Support derivation of Hash for Str and List 2022-10-04 14:09:40 -05:00
Ayaz Hafiz
8844cd256e
Make sure Num.minU128/Num.maxU128 is properly exposed 2022-10-04 14:09:40 -05:00
Ayaz Hafiz
e9efc95425
Obligation checking for the Hash ability
This implements type-level checks that types can and cannot implement
the `Hash` ability.

Part of #4195
2022-10-04 10:51:14 -05:00
Ayaz Hafiz
eadbc0912a
Update the compiler to be aware of Hash 2022-10-04 10:22:22 -05:00
Ayaz Hafiz
ec40c3aa0e
Derive Copy 2022-10-02 21:42:43 -05:00
Ayaz Hafiz
0cc9ea4b05
Detect and report module names that don't match what they are used as
Prior to this commit, if you had a module structure like

```
| - A.roc
| - Dep
    | - B.roc
```

where `B.roc` was defined as

```
interface B exposes [] imports []
```

and `A.roc` was defined as

```
interface A exposes [] imports [Dep.B]
```

The compiler would hang on you. The reason is that even though we expect
`B` to be named `Dep.B` relative to `A`, that would not be enforced.

With this patch, we now enforce such naming schemes - a module must have
the namespaced name it is referenced by. Currently, we determine the
expected namespaced name by looking at how transitive dependencies of the
root module reference the module. In the future, once we have a package
ecosystem and a solid idea of "package roots", we can use the "package
root" to determine how a module should be named.

Closes #4094
2022-10-02 21:38:03 -05:00