Commit Graph

469 Commits

Author SHA1 Message Date
Anton-4
1126f85b5a
fix clippy unnecessary hashes 2024-01-01 16:38:36 +01:00
Anton-4
cd632fe549
Merge branch 'main' of github.com:roc-lang/roc into clippy-1.74 2023-12-25 17:05:37 +01:00
Bryce Miller
59eb28ef58
Add builtin List.walkWithIndexUntil 2023-12-11 23:04:40 -05:00
Ayaz
aaba3f4d82
Merge branch 'main' into clippy-1.74 2023-12-02 20:09:06 -06:00
Ayaz Hafiz
a53da2bc24
Make sure late specializations of opaques inherit Inspect as needed
A "late specialization" of a type is an ability specialization that
is not visible or needed until after type-specialization; i.e. during
monomorphization.

The `Inspect.toInspector` ability is special-cased for opaques that do
not claim or explicitly implement `Inspect`. In such cases, they are
treated as structural types, and given the immediate specialization of
`Inpect.inspectOpaque`.

However, prior to this commit, that special-casing would only be applied
during early specialiation (i.e. specializations visible during
generalized type inference). This commit applies the special case to
late specialization as well - the specialization decision for an opaque
type is always the specialization of the opaque type in the late case,
but now, when we go to look up the ambient lambda set of the
specialization, if it does not exist and corresponds to
`Inspect.toInspector`, we fall back to the immediate.

One concern I have here is that in a case like

```
Op := {}

x =
    dbg (@Op {})
```

the specialization of `Inspect.toInspector` for `Op` should be known
early. Indeed, the program

```
Op := {}

x =
    Inspect.toInspector (@Op {}) |> Inspect.apply (Inspect.init {}) |> Inspect.toDbgStr
```

Compiles fine without this change. This makes me suspect there is an
issue with the implementation of `dbg`'s desugaring. If possible, this
should be addressed sooner rather than later.

Closes #6127
2023-11-30 22:25:08 -06:00
Brendan Hansknecht
c49046291a
misc cleanup suggestions 2023-11-28 16:40:43 -08:00
Brendan Hansknecht
c443bdcf4f
check_adhoc for inspect 2023-11-28 16:40:41 -08:00
Brendan Hansknecht
82cda1965c
use INSPECT_INSPECT_ABILITY instead of INSPECT_INSPECT 2023-11-28 16:40:41 -08:00
Brendan Hansknecht
35078a2295
allow nat in DeriveInspect 2023-11-28 16:40:41 -08:00
Brendan Hansknecht
3434d3154a
Ayaz's fix and first passing inspect test 2023-11-28 16:40:40 -08:00
Richard Feldman
443f6593c5
Add Inspect.Inspect to subs and auto-derive 2023-11-28 16:40:40 -08:00
Ayaz Hafiz
5c805ce80f
Get first inspect for non-Inspect-implementing opaques specialized 2023-11-28 16:40:39 -08:00
Richard Feldman
00c27b087b
Add Inspect to builtin_module_with_unlisted_ability_impl 2023-11-28 16:40:39 -08:00
Richard Feldman
fb9e0fc777
Add Inspect to obligation checker 2023-11-28 16:40:39 -08:00
Folkert
c019ced31d
various 2023-11-18 23:05:55 +01:00
Richard Feldman
6bd9fcd6e9
roc_solve shouldn't depend on itself 2023-11-10 16:04:06 -05:00
Isaac Van Doren
139d3c6f89
make dropFirst and dropLast drop n elements 2023-10-29 13:23:33 -05:00
Ayaz Hafiz
6e89821233
Update language server to support apps 2023-10-25 17:14:33 -05:00
Ayaz Hafiz
b706a57e16
Update LSP 2023-10-25 17:14:33 -05:00
Ayaz Hafiz
9d365a8a57
Support basic diagnostic reporting 2023-10-25 17:14:32 -05:00
Richard Feldman
dc7e8b43bd
Rename Float to Frac in more places 2023-09-11 08:50:13 -04:00
Richard Feldman
2da41be29f
Merge remote-tracking branch 'origin/main' into abilities-syntax 2023-08-10 20:36:01 -04:00
Folkert
5d3c7a9363
remove HostExposedAlias 2023-08-09 14:06:07 +02:00
Folkert
43adf0635e
freshen annotations 2023-07-24 21:24:33 +02:00
Ayaz Hafiz
8b7823a237
Fix types 2023-07-17 10:10:50 -05:00
Ayaz Hafiz
1282110ef5
Push checkmate through load 2023-07-17 09:51:00 -05:00
Ayaz Hafiz
18e9f8f034
Move unify::Mode to roc_solve_schema 2023-07-17 09:50:36 -05:00
Ayaz Hafiz
87d108eccc
Push checkmate through env 2023-07-17 09:48:59 -05:00
Ayaz Hafiz
558d7459b4
Fix merge conflicts 2023-07-12 14:14:25 -05:00
Ayaz Hafiz
6e5a308557
Content variant ErasedLambda 2023-07-12 13:57:17 -05:00
Ayaz Hafiz
16ebcba053
Use index 2023-07-12 13:53:51 -05:00
Ayaz Hafiz
6014370b91
Initial support for erasure in tests 2023-07-12 13:53:51 -05:00
Ayaz Hafiz
1d6f0d3d3f
Instantiate erased lambdas 2023-07-12 13:53:51 -05:00
Ayaz Hafiz
33b1b8236a
Break up SolveEnv 2023-07-12 13:53:51 -05:00
Ayaz Hafiz
15eef74a83
Shove more into a common env 2023-07-12 13:53:51 -05:00
Ayaz Hafiz
f8e377a055
Break up solve/solve into smaller modules 2023-07-12 13:53:50 -05:00
Ayaz Hafiz
44c4797d9a
Parameterize program solving on a FunctionKind
This new flag determines whether we should introduce a new kind to
represent lambda sets, or whether lambdas should be erased. The latter
is not yet implemented.
2023-07-12 13:53:50 -05:00
Folkert
ef39bad7c6
auto clippy fixes 2023-07-10 18:27:08 +02:00
Ayaz Hafiz
739343a5b6
Clippy 2023-06-22 14:32:07 -05:00
Ayaz Hafiz
e019ec6736
Add todo 2023-06-22 14:31:49 -05:00
Ayaz Hafiz
adf961ba0b
Use UEnv where possible 2023-06-22 14:31:49 -05:00
Ayaz Hafiz
ad20a2ee41
Shove more into a common env 2023-06-22 14:31:48 -05:00
Ayaz Hafiz
b5ea2c2c99
s/SolveCtx/SolveConfig/g 2023-06-22 14:31:36 -05:00
Ayaz Hafiz
4f7f66d695
Reorder 2023-06-22 14:31:24 -05:00
Ayaz Hafiz
8314d44650
Break up solve/solve into smaller modules 2023-06-22 14:31:14 -05:00
Ayaz Hafiz
d1dad56331
Rename env to scope 2023-06-22 14:31:03 -05:00
Ayaz Hafiz
683b586f60
Use more structs instead of tuples 2023-06-22 14:31:02 -05:00
Hannes
97fa6758d0 Rename trimLeft to trimStart and trimRight to trimEnd 2023-06-19 13:17:59 +08:00
Bryce Miller
cb08225bf0
| -> where 2023-06-05 20:19:00 -04:00
Bryce Miller
dbc0204532
abilities syntax has -> implements 2023-05-24 21:30:16 -04:00