Ayaz Hafiz
6bb97c92b9
Canonicalize multiple abilities bound to a type variable
2022-10-24 13:56:07 -05:00
Ayaz Hafiz
548a235c25
Support parsing multiple abilities in a clause
2022-10-24 13:56:06 -05:00
Ayaz Hafiz
e75f3c3c79
Get rid of MemberImpl::Derived
...
We don't need this anymore, since derived members become Impls during
canonicalization now!
2022-10-23 20:48:07 -05:00
Ayaz Hafiz
1d885c4ab2
Support deriving Decode for opaques
2022-10-23 20:48:06 -05:00
Ayaz Hafiz
61ba59de07
Even more unneeded allocations
2022-10-23 20:48:06 -05:00
Ayaz Hafiz
bb8888b115
Make sure we don't report errors for illegal derived bodies, just their decls
2022-10-23 20:48:05 -05:00
Ayaz Hafiz
3f09de7052
Remove unused var
2022-10-23 20:47:43 -05:00
Ayaz Hafiz
59dfc4ab99
Move can-derived bodies to their own module
2022-10-23 20:47:43 -05:00
Ayaz Hafiz
6edab8b7cc
Avoid unneeded allocations
2022-10-23 20:47:43 -05:00
Ayaz Hafiz
c4f9aa6fe6
Add deriving toEncoder for opaques
2022-10-23 20:47:42 -05:00
Ayaz Hafiz
83813afeaf
Derive Eq for opaques
2022-10-23 20:46:56 -05:00
Ayaz Hafiz
40e05d5a00
Add support for deriving Hash for opaques
2022-10-23 20:46:56 -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
Folkert de Vries
be624f8bcb
Merge pull request #4359 from roc-lang/i4313
...
Disallow typing optional fields when required fields are annotated
2022-10-23 01:20:55 +02:00
Folkert de Vries
4a5c8fd7ae
Merge pull request #4303 from roc-lang/i4291
...
Make sure self-recursive checks only happen after typechecking
2022-10-23 01:18:56 +02:00
Ayaz Hafiz
05e8e6de6f
Disallow typing optional fields when required fields are annotated
...
Closes #4313
2022-10-18 15:50:20 -05:00
Ayaz Hafiz
d26e9c81e0
Resolve ability specializations looked up in expects
2022-10-17 17:56:48 -05:00
Ayaz Hafiz
8aee32830a
Add symbols' localized type variable to the AST
2022-10-17 17:35:48 -05:00
Ayaz Hafiz
3d34de5fc1
Remove test caught by reporting tests
2022-10-17 09:59:34 -05:00
Ayaz Hafiz
ecab8fa25a
Make sure self-recursive checks only happen after typechecking
...
Programs like
```
after : ({} -> a), ({} -> b) -> ({} -> b)
fx = after (\{} -> {}) \{} -> if Bool.true then fx {} else {}
```
are legal because they always decay to functions, even if they may not
look like functions syntactically. Rather than using a syntactic check
to check for illegally-recursive functions, we should only perform such
checks after we know the types of values.
Closes #4291
2022-10-17 09:59:32 -05:00
Ayaz
c1c339dbdf
Merge pull request #4304 from roc-lang/i4259
...
Make sure type variables bound to abilities are instantiated in aliases
2022-10-14 16:07:58 -05:00
Ayaz Hafiz
20e4295eea
Make sure type variables bound to abilities are instantiated in aliases
...
Closes #4259
2022-10-14 13:56:00 -05:00
Ayaz Hafiz
12ecdab4c5
Add listGetUnsafe to Dict.roc rather than exposing from list
2022-10-14 13:43:31 -05:00
Ayaz Hafiz
6149c289fc
Update Eq symbols
2022-10-12 16:38:36 -05:00
Ayaz Hafiz
8d91370836
TODO is resolved
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
bd5f5ed735
Old implementations can be overwritten before solving
2022-10-12 16:37:51 -05:00
Ayaz Hafiz
c618ced743
Replace Bool.isEq
with Eq.isEq
2022-10-12 16:37:49 -05:00
Ayaz Hafiz
3674f6861e
Compile derived structural equality
2022-10-12 16:37:49 -05:00
Ayaz Hafiz
7e79ff55f1
Serialize abilities store and solved implementations with subs
2022-10-11 10:31:21 -05:00
Ayaz Hafiz
46eb427393
Use roc_serialize in serializing abilities store, and add tests
2022-10-11 09:41:47 -05:00
Ayaz Hafiz
9131a55a72
First pass at serializing the abilities store
2022-10-10 19:32:17 -05:00
Ayaz
51c687df54
Merge branch 'main' into i4150
...
Signed-off-by: Ayaz <20735482+ayazhafiz@users.noreply.github.com>
2022-10-08 16:08:35 -05:00
Ayaz
9d05bcd9d8
Merge pull request #4237 from snprajwal/str-withcapacity
...
builtin(str): implement Str.withCapacity
2022-10-08 14:31:30 -05:00
Ayaz
fae90c9fd2
Merge pull request #4187 from roc-lang/ranged-char-literal
...
Single-quote literals behave like ranged numbers
2022-10-07 15:05:09 -05:00
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
Ayaz Hafiz
d9207137e8
Implement Num.isZero as a low-level
...
This will be needed ahead of the `Eq` ability.
Closes #4223
2022-10-05 19:47:29 -05:00
Ayaz Hafiz
619cd2f629
Infer ranged number for chars in patterns
2022-10-05 17:28:01 -05:00
Ayaz Hafiz
178b634266
Treat single quote literals as ranged numbers for inference purposes
2022-10-05 17:28:00 -05:00
Ayaz Hafiz
61cf8e53e6
Have FunctionOrTagUnion include multiple possible tags
2022-10-05 17:24:52 -05:00
Ayaz Hafiz
92b754f292
Illegal self recursion on toplevel defs
...
Closes #4153
2022-10-03 13:14:56 -05:00
Ayaz Hafiz
f745debc73
Fix scope tests
2022-09-30 13:40:34 -05:00
Ayaz Hafiz
92aa0912ea
Report unused imports in modules
2022-09-30 13:40:34 -05:00
Ayaz Hafiz
5f117be306
Improve error message when shadowing builtin type
...
Closes #3109
2022-09-30 13:40:34 -05:00
Ayaz Hafiz
6832d4054f
Better name imported
symbols to apply
or hint
symbols
2022-09-30 13:40:33 -05:00
Ayaz Hafiz
01815ad23f
Ability impls that don't shadow can end up resolving to the member def
2022-09-21 12:29:06 -05:00
Ayaz Hafiz
67d0a3d36f
Symbol resolution of ability members can come from unique defs or unique shadows
2022-09-21 12:29:06 -05:00
Ayaz
211c297230
Merge pull request #4041 from KilianVounckx/opaque-bool
...
Opaque bool
2022-09-21 11:15:41 -05:00