Commit graph

337 commits

Author SHA1 Message Date
Ayaz Hafiz
b0a8b85de3
Canonicalization of list patterns 2022-10-31 17:04:47 -05:00
Ayaz Hafiz
07f5d0c7fd
Clarify TODO 2022-10-31 09:39:29 -05:00
Ayaz Hafiz
debe6332c5
Support OIOP for type aliases 2022-10-31 09:38:21 -05:00
Ayaz Hafiz
91dd47c5e4
Store OIOP variables in a unique buffer 2022-10-31 09:38:21 -05:00
Ayaz Hafiz
cfe7c8e5ef
Warn on the presence of unnecessary wildcards in output positions 2022-10-31 09:38:20 -05:00
Ayaz Hafiz
8d5678151d
Implement open-in-output-position for non-alias type annotations 2022-10-31 09:37:41 -05:00
Ayaz Hafiz
4d35ab9957
Parse list patterns 2022-10-26 17:03:22 -05:00
Folkert de Vries
02a76bb8bd
Merge pull request #4399 from roc-lang/no-types-in-constraining-api
Have most constraining APIs take a type index rather than `Type`
2022-10-26 19:45:55 +02:00
Ayaz
316ae7d30b
Merge pull request #4398 from roc-lang/emplace-type-variables
Leave variables behind when converting `Type`s to variables
2022-10-26 12:41:55 -05:00
Ayaz Hafiz
084393c326
store_index is now redundant 2022-10-24 18:21:05 -05:00
Ayaz Hafiz
bff3d534f6
Store expects type index 2022-10-24 18:20:18 -05:00
Ayaz Hafiz
278754506f
lookup expects type index 2022-10-24 18:14:28 -05:00
Ayaz Hafiz
97d47cc05f
includes_tag expects type index 2022-10-24 18:08:45 -05:00
Ayaz Hafiz
556222caa1
is_open_type expects type index 2022-10-24 17:51:39 -05:00
Ayaz Hafiz
0f0c02965a
pattern_presence expects type index 2022-10-24 17:49:02 -05:00
Ayaz Hafiz
0990eda0cb
equal_pattern_types takes type index 2022-10-24 17:41:13 -05:00
Ayaz Hafiz
c53e08f63c
equal_types_with_storage takes type index 2022-10-24 17:35:09 -05:00
Ayaz Hafiz
cca5f53e98
equal_types_var requires a type index 2022-10-24 17:30:04 -05:00
Ayaz Hafiz
55d7f3f658
Require type and expected indices in equal_types constraints 2022-10-24 14:05:19 -05:00
Ayaz Hafiz
c0257302a9
Address clippy lints 2022-10-24 14:00:45 -05:00
Ayaz Hafiz
46b741e9dd
Correctly clone able vars across subs 2022-10-24 13:59:52 -05:00
Ayaz Hafiz
1e6181d2cb
New data structure for storing sorted abilities bound to a variable 2022-10-24 13:59:51 -05:00
Ayaz Hafiz
229548571b
Represent "able" variables with slices of abilities 2022-10-24 13:59:51 -05:00
Ayaz Hafiz
0f0678ce73
s/closure_names/symbol_names/g in subs 2022-10-24 13:59:51 -05:00
Ayaz Hafiz
2011ec97c3
Store multiple abilities as a VecSet 2022-10-24 13:59:51 -05:00
Ayaz Hafiz
603160dae3
Report errors for duplicate bound abilities 2022-10-24 13:59:50 -05:00
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
9b24205906
Emplace variables made from types in expectations 2022-10-24 13:11:35 -05:00
Ayaz Hafiz
d3e14550d8
Leave variables behind when converting Types to variables
This is part one of addressing the present issues with emplacing type
directly where type variables should be reused. Now, when an
`Index<Type>` is converted to a variable in solving, we leave the
converted variable in the `Type`'s place. Specifically, we keep an index
to a `Cell<Type>`.

Note that this transformation is only temporary, it will be removed once
we merge this with the `Type` SoA representation, but it is needed in
the meantime as I transform the `Constrain` API to get rid of
type-emplacement.
2022-10-24 11:42:35 -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
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