Commit Graph

649 Commits

Author SHA1 Message Date
Folkert
00f3eaf2a1
thread through DelayedAlias 2022-03-14 19:47:19 +01:00
ayazhafiz
5670fe06cd Deal with destructuring tag unions behind opaques correctly
Closes #2702
2022-03-13 18:44:38 -05:00
Folkert
15ac77567a
make rigid variable introducion more obvious 2022-03-13 18:27:42 +01:00
Folkert
523032c6c9
more comments 2022-03-13 14:05:53 +01:00
Folkert
ed247c9da3
Merge remote-tracking branch 'origin/trunk' into type-checking-storage-subs 2022-03-13 13:43:00 +01:00
Folkert
eccb461b01
get fancy, store variable directly in the index 2022-03-13 01:59:28 +01:00
Folkert
b3d9f9c2de
use EitherIndex<Type, Variable> to halve number of types stored 2022-03-13 01:46:49 +01:00
Folkert
da03b0c2b3
add either_type_index_to_var 2022-03-13 01:45:23 +01:00
Folkert
e3e9215578
Merge remote-tracking branch 'origin/trunk' into type-checking-storage-subs 2022-03-12 14:10:43 +01:00
Folkert
6bb8bcb5a2
cleanup 2022-03-12 14:02:34 +01:00
Folkert
d9c3a7ddd9
get rid of unneeded field on SolvedModule 2022-03-12 14:00:51 +01:00
Folkert
c64f768abe
more comments 2022-03-12 13:52:13 +01:00
Folkert
01b810266b
test cleanup 2022-03-11 22:15:36 +01:00
Folkert
364bc81dc4
stop making solved types for non-builtins 2022-03-11 21:08:24 +01:00
Brendan Hansknecht
d681062c63 add Num.toNat 2022-03-11 11:17:42 -08:00
Folkert
30e7d94c95
clarify old constraint gen is now just for the builtins 2022-03-11 19:25:42 +01:00
Folkert
aebb3a162e
it's alive! 2022-03-11 17:27:44 +01:00
Folkert
9054546d27
move things in place to go storage_subs -> subs 2022-03-11 10:49:22 +01:00
Folkert
28abf5b1b8
store exposed values as storage subs 2022-03-11 10:12:25 +01:00
Folkert
831a90e310
Merge remote-tracking branch 'origin/trunk' into builtins-in-roc 2022-03-08 22:36:06 +01:00
Folkert de Vries
ce1839133b
Merge pull request #2661 from rtfeldman/i/2541
Report invalid extension types during canonicalization
2022-03-07 16:12:04 +01:00
ayazhafiz
47e4904075 Chase aliases when checking for valid extension types 2022-03-06 22:17:58 -05:00
Folkert
ba2f9ba779
Merge remote-tracking branch 'origin/trunk' into content-flattype-copy 2022-03-06 20:52:04 +01:00
Folkert de Vries
27f367ec23
Merge pull request #2656 from rtfeldman/type-to-var-tco
Optimize type_to_variable
2022-03-06 20:44:14 +01:00
Folkert
a9c8e2dc3e
copy instead of clone Content 2022-03-06 19:07:18 +01:00
hafiz
de9da2d8a5
Merge pull request #2657 from rtfeldman/i/2567
Register accessor closures when they are bound
2022-03-06 12:59:55 -05:00
Folkert
29bf4195a1
make FlatType Copy 2022-03-06 18:15:26 +01:00
Folkert
41e56519ef
prevent a subs lookup by reserving a Variable 2022-03-06 18:00:25 +01:00
Richard Feldman
2a6a197fdf
Merge pull request #2653 from rtfeldman/def-types-tweaks
Def types tweaks
2022-03-06 11:25:37 -05:00
Folkert
47a1e5f816
Merge branch 'type-to-var-tco' into builtins-in-roc 2022-03-06 17:00:57 +01:00
ayazhafiz
3bff99b0a2 Register accessor closures when they are bound
Previously we only registered record accessor closures in anonymous
contexts, where we assume they must already be specialized based on the
surrounding contexts. This is not true in general since one might bind
an accessor to a name.

Closes #2567
2022-03-06 10:53:12 -05:00
Folkert
0f5c339b4f
and roc_result_to_var 2022-03-06 15:29:23 +01:00
Folkert
eec92204f1
optimize type_to_union_tags 2022-03-06 15:13:39 +01:00
Folkert
8b526e4f58
clippy 2022-03-06 14:54:19 +01:00
Folkert
592a5ace19
optimize recursive call 2022-03-06 14:14:47 +01:00
Folkert
a37a895016
optimize tag name cache 2022-03-06 14:11:33 +01:00
Folkert
04818292a8
Make type_to_variable manually tail-recursive
by using a work stack and reserving variables. fun stuff
2022-03-06 13:22:55 +01:00
Folkert
7ad55d67e2
Make type_to_variable manually tail-recursive
by using a work stack and reserving variables. fun stuff
2022-03-06 13:15:50 +01:00
Folkert
4806dc378f
add comment and assert back 2022-03-05 23:49:21 +01:00
Folkert
0351b9fce7
improvements to adjust_rank 2022-03-05 23:45:07 +01:00
Folkert
97d9027271
improve pool_to_rank_table 2022-03-05 23:44:57 +01:00
Folkert
3372d7184e
improvements to adjust_rank 2022-03-05 23:29:33 +01:00
Folkert
fd179c8b4e
improve pool_to_rank_table 2022-03-05 23:07:57 +01:00
Folkert
6009768991
Merge branch 'def-types-tweaks' into builtins-in-roc 2022-03-05 22:36:59 +01:00
Folkert
c7c9a90d65
restructure how def_types are stored in Constraints 2022-03-05 21:47:49 +01:00
Folkert
adf4ad22a5
Merge remote-tracking branch 'origin/trunk' into builtins-in-roc 2022-03-05 20:55:15 +01:00
hafiz
cad02d878c
Merge pull request #2645 from rtfeldman/solve-fully-tail-recursive
make solve fully tail recursive
2022-03-05 14:35:39 -05:00
Folkert
1b66247303
renaming 2022-03-05 19:30:15 +01:00
Folkert
fc4212310f
Merge remote-tracking branch 'origin/trunk' into solve-fully-tail-recursive 2022-03-05 18:34:09 +01:00
Folkert
80956061dd
fix formatting bug in type pretty-print 2022-03-05 15:03:59 +01:00
Folkert
6370a80c62
make sure lambda sets within aliases are in IntroducedVariables 2022-03-05 14:29:34 +01:00
Folkert
d158702e1a
Merge remote-tracking branch 'origin/trunk' into take-scratchpad-bug 2022-03-05 02:15:46 +01:00
Folkert
8c321c1aa4
fix a bug with taking a scratchpad arena 2022-03-05 02:12:10 +01:00
Folkert
a79f6c6cdd
restructure and add comments 2022-03-05 01:29:21 +01:00
Folkert
c7d8ae6c79
make complex case tail-recursive 2022-03-05 01:02:27 +01:00
Folkert
3a1add6ce8
add LocalDefVarsVec::from_def_types 2022-03-05 00:53:27 +01:00
Folkert
41df04184e
make the simple case tail-recursive 2022-03-05 00:26:03 +01:00
Folkert
4ca9ea0b89
refactor After 2022-03-04 23:57:41 +01:00
Folkert
38d3d3169a
drop final suffixes 2022-03-02 21:30:38 +01:00
Folkert
546afc9661
drop soa suffix 2022-03-02 21:21:37 +01:00
Folkert
0eb98a4c59
move over constraint 2022-03-02 21:19:58 +01:00
Folkert
c52029c2d1
the debugging begins 2022-03-02 20:30:42 +01:00
Folkert
fe48bdf5b1
make solve that uses new constraint 2022-03-02 19:43:03 +01:00
Folkert
19d7f7ce09
make vars-by-symbol a vector 2022-03-01 21:51:25 +01:00
Folkert
8b457a56c5
reduce cloning of Env 2022-03-01 00:08:56 +01:00
Folkert
d3bbf6d504
struct of arrays! 2022-03-01 00:00:50 +01:00
Folkert
1ef9546391
use Vec instead of MutMap 2022-02-28 23:54:35 +01:00
Folkert
9d82f795b7
make it abstract 2022-02-28 23:43:58 +01:00
Folkert
751ae125a5
remove aliases from solve Env 2022-02-28 23:41:07 +01:00
Folkert
c18befeccf
short-circuit aliases 2022-02-28 23:37:33 +01:00
Folkert
bd31503855
Merge remote-tracking branch 'origin/trunk' into builtins-in-roc 2022-02-28 18:55:20 +01:00
ayazhafiz
01da425851 Simplify solve worklist substantially 2022-02-27 16:41:31 -05:00
Folkert
db1669154e
WIP 2022-02-27 21:53:56 +01:00
ayazhafiz
56d4dc3480 Transition solve to use a worklist rather than always recursing
This should unblock some of @folkertdev's work on transitioning builtins
to pure Roc code. It's not perfect yet (we still make some recursions),
but it's a step, and it should avoid recursing on `Let`
`ret_constraint`s, which caused stack overflows when they became really
long before.
2022-02-27 15:51:19 -05:00
ayazhafiz
07b1829732 Improve error reporting for patterns not matching opaques 2022-02-27 00:11:11 -05:00
ayazhafiz
059c324268 Error reporting for type mismatches involving opaques 2022-02-27 00:10:12 -05:00
ayazhafiz
b6d7229525 Infer + checking tests for opaques 2022-02-27 00:10:12 -05:00
Folkert
65b1b3fcce
just before Num 2022-02-26 23:11:40 +01:00
Folkert
c0d3543d5a
make Str + Result work 2022-02-26 17:52:24 +01:00
hafiz
ca9ecbea52
Merge pull request #2533 from rtfeldman/abilities!
[WIP] Spike for abilities and friends
2022-02-21 23:18:40 -05:00
ayazhafiz
90de82e295 Validation of opaques during canonicalization 2022-02-21 18:25:19 -05:00
ayazhafiz
6b53692aac Canonicalize opaque types 2022-02-20 13:47:01 -05:00
ayazhafiz
d90915a8cd Implement Num.to* builtins
Just wrap over Num.intCast
2022-02-19 11:28:41 -05:00
ayazhafiz
909fae5b6c Generalize recursion variables properly
Closes #2379
Closes #2481
2022-02-18 00:07:38 -05:00
Folkert
04adbe75ca fix test compilation 2022-02-14 21:09:51 +01:00
ayazhafiz
8c0e39211d Instantiate recursive aliases to their smallest closures
Now, when we have two aliases like

```
T a : [ A, B (U a) ]
U a : [ C, D (T a) ]
```

during the first pass, we simply canonicalize them but add neither to
the scope. This means that `T` will not be instantiated in the
definition of `U`. Only in the second pass, during correction, do we
instantiate both aliases **independently**:

```
T a : [ A, B [ C, D (T a) ] ]
U a : [ C, D [ A, B (U a) ] ]
```

and now we can mark each recursive, individually:

```
T a : [ A, B [ C, D <rec1> ] ] as <rec1>
U a : [ C, D [ A, B <rec2> ] ] as <rec2>
```

This means that the surface types shown to users might be a bit larger,
but it has the benefit that everything needed to understand a layout of
a type in later passes is stored on the type directly, and we don't need
to keep alias mappings.

Since we sort by connected components, this should be complete.

Closes #2458
2022-02-11 08:43:33 -05:00
ayazhafiz
0d241f3c3c Only expand ErrorType::Range's type range when range unification fails 2022-02-06 15:04:13 -05:00
ayazhafiz
680bf8e0b7 Treat rigids as flex vars when checking number range types 2022-02-06 15:04:12 -05:00
ayazhafiz
c5d918e68c Include floats in bounds for unspecified numbers 2022-02-06 15:04:12 -05:00
ayazhafiz
8dc92ccd97 Second pass 2022-02-06 15:04:12 -05:00
ayazhafiz
5e0d90ac53 First pass 2022-02-06 15:04:12 -05:00
ayazhafiz
df8113ce32 Typecheck numeric suffixes in patterns 2022-02-01 23:35:14 -05:00
ayazhafiz
e03592930f Typecheck numeric literals with suffixes in expressions
Part of #2350
2022-02-01 22:49:50 -05:00
ayazhafiz
d10eb0f9a3 Fix Apply usage 2022-01-31 23:00:37 -05:00
Folkert
afd11e1cb1 move target -> roc_target 2022-01-26 23:33:29 +01:00
Folkert
b9c318e9fb update the tests 2022-01-26 15:59:21 +01:00
Jan Van Bruggen
591477e77b Add most remaining Num.min/max* builtins
This skips `min/maxU128`, as they require a subtle change
to the `I128`-centric implementation of `Int`s.
2022-01-17 15:26:23 -07:00
Jan Van Bruggen
d7e2be306f WIP: Add Num.minI128 builtin (TODOs remain) 2022-01-15 17:49:15 -07:00
Joshua Warner
a3c6bfce43 Mark infer_union_def_position as a test (followup to #2305) 2022-01-03 20:11:06 -08:00
ayazhafiz
8e7ca57458 Close tag unions that are in the left hand side of an assignment 2021-12-30 19:51:14 -06:00
ayazhafiz
fda6c70835 Mark patterns in lambda argument position as having a presence constraint
Closes #2299
2021-12-30 18:21:28 -06:00
ayazhafiz
b3ddfa7515 Parse destructured tag annotations as annotations rather than aliases
Closes #178
2021-12-26 16:11:29 -06:00
ayazhafiz
409ced0ef2 Simply constraint matching in solve 2021-12-23 20:22:42 -06:00
ayazhafiz
1f81a598f7 Presence constraint flag -> Enum 2021-12-23 19:40:18 -06:00
ayazhafiz
b4c9068676 Make pattern presence constraints an enum variant 2021-12-23 19:40:18 -06:00
ayazhafiz
b97ff380e3 Presence constraints for tag union types
This work is related to restricting tag union sizes in input positions.
As an example, for something like

```
\x -> when x is
    A M -> X
    A N -> X
    A _ -> X
```

we'd like to infer `[A [M, N]* ]` rather than the `[A, [M, N]* ]*` we
infer today. Notice the difference is that the former type tells us we
only accepts `A`s, but the argument of the `A` can be `M`, `N` or
anything else (hence the `_`).

So what's the idea? It's an encoding of the "must have"/"might have"
design discussed in https://github.com/rtfeldman/roc/issues/1758. Let's
take our example above and walk through unification of each branch.

Suppose `x` starts off as a flex var `t`.

```
\x -> when x is
    A M -> X
```

Now we introduce a new kind of constraint called a "presence"
constraint. It says "t has at least [A [M]]". I'll notate this as `t +=
[A [M]]`. When `t` is free as it is here, this is equivalent to `t ~
[A [M]]`.

```
\x -> when x is
    ...
    A N -> X
```

At this branch we introduce the presence constraint `[A [M]] += [A [N]]`.
Notice that there's two tag unions we care about resolving here - one is
the toplevel one that says "I have an `A ...` inside of me", and the
other one is the tag union that's the tyarg to `A`. They are distinct
and at different depths.

For the toplevel one, we first figure out if the number of tags in the
union needs to expand. It does not - we're hoping to resolve the type
`[A [M, N]]`, which only has `A` in the toplevel union. So, we don't
need to do anything extra there, other than the merge the nested tag
unions.

We recurse on the shared tags, and now we have the presence constraint
`[M] += [N]`. At this point it's important to remember that the left and
right hand types are backed by type variables, so this is really
something like `t11 [M] += t12 [N]`, where `[M]` and `[N]` are just what
we know the variables `t11` and `t12` to be at this moment. So how do we
solve for `t11 [M, N]` from here? Well, we can encode this constraint as
a type variable definition and a unification constraint we already know
how to solve:

```
New definition: t11 [M]a    (a fresh)
New constraint: a ~ t12 [N]
```

That's it; upon unification, `t11 [M, N]` falls out.

Okay, last step.

```
\x -> when x is
    ...
    A _ -> X
```

We now have `[A [M, N]] += [A a]`, where `a` is a fresh unbound
variable. Again nothing has to happen on the toplevel. We walk down and
find `t11 [M, N] += t21 a`. This is actually called an "open constraint"; we
differentiate it at the time we generate constraints because it follows
syntactically from the presence of an `_`, but it's semantically
equivalent to the presence constraint `t11 [M, N] += t21 a`. It's just
called opening because literally the only way `t11 [M, N] += t21 a` can
be true is if we set `t11 a`. Well, actually, we assume `a` is a tag
union, so we just make `t11` the open tag union `[M, N]a`. Since `a` is
unbound, this eventually becomes a wildcard and hence falls out `[M, N]*`.
Also, once we open a tag union with an open constraint, we never close
it again.

That's it. The rest falls out recursively. This gives us a really easy
way to encode these ordering constraints in the unification-based system
we have today with minimal additional intervention. We do have to patch
variables in-place sometimes, and the additive nature of these
constraints feels about out-of-place relative to unification, but it
seems to work well.

Resolves #1758
2021-12-23 19:40:18 -06:00
Folkert de Vries
5f7476d54f
Merge pull request #2266 from rtfeldman/joshuawarner32/loc
Parser refactor: always group (Row, Col) into Position
2021-12-24 00:02:13 +01:00
Folkert de Vries
db44d03e66
Merge pull request #2259 from rtfeldman/i/2227-record-layout-hang
Turn invalid record field types into runtime errors
2021-12-23 20:17:34 +01:00
Joshua Warner
f19220473a Rename Located -> Loc 2021-12-22 19:18:22 -08:00
ayazhafiz
88888b0854 Mark tag unions to recursive when they become so during unification
See the comment on line 811 of unify.rs in this commit for motivation
and justification.

Closes #2217
2021-12-22 17:51:07 -06:00
ayazhafiz
576f1293fd Turn invalid record field types into runtime errors
By emitting a runtime error rather than panicking when we can't layout
a record, we help programs like

```
main =
    get = \{a} -> a
    get {b: "hello world"}
```

execute as

```
Mismatch in compiler/unify/src/unify.rs Line 1071 Column 13
Trying to unify two flat types that are incompatible: EmptyRecord ~ { 'a' : Demanded(122), }<130>

🔨 Rebuilding host...
── TYPE MISMATCH ───────────────────────────────────────────────────────────────

The 1st argument to get is not what I expect:

8│      get {b: "hello world"}
            ^^^^^^^^^^^^^^^^^^

This argument is a record of type:

    { b : Str }

But get needs the 1st argument to be:

    { a : a }b

Tip: Seems like a record field typo. Maybe a should be b?

Tip: Can more type annotations be added? Type annotations always help
me give more specific messages, and I think they could help a lot in
this case

────────────────────────────────────────────────────────────────────────────────

'+fast-variable-shuffle' is not a recognized feature for this target (ignoring feature)
'+fast-variable-shuffle' is not a recognized feature for this target (ignoring feature)
Done!
Application crashed with message

    Can't create record with improper layout

Shutting down
```

rather than the hanging

```
Mismatch in compiler/unify/src/unify.rs Line 1071 Column 13
Trying to unify two flat types that are incompatible: EmptyRecord ~ { 'a' : Demanded(122), }<130>

thread '<unnamed>' panicked at 'invalid layout from var: UnresolvedTypeVar(104)', compiler/mono/s
rc/layout.rs:1510:52
```

that was previously produced.

Part of #2227
2021-12-21 19:11:59 -06:00
Folkert
c6b06005cc mut not needed 2021-12-05 15:40:11 +01:00
Folkert
4af9539ce6 fixes by cargo clippy --fix 2021-12-05 15:04:28 +01:00
Folkert
27269faa0b optimize alias to var conversion 2021-12-01 18:39:45 +01:00
rvcas
40090f20e6 test: update tests to use Num.toStr 2021-11-30 14:56:08 -05:00
Richard Feldman
d39ecfd12d
Merge pull request #2052 from rtfeldman/i/1931-2
Some improvements to error messages regarding unbound type variables
2021-11-26 21:17:37 -05:00
Folkert
6934e69240 make deep_copy_var_to allocate less 2021-11-27 02:09:08 +01:00
Folkert
471593ea31 make deep_copy_var use scratchpad arena 2021-11-27 01:32:47 +01:00
Folkert
2d0d54e13e try stack allocation for small vectors 2021-11-27 01:31:48 +01:00
Folkert
b4f21930bb cleanup 2021-11-25 20:49:44 +01:00
Folkert
612f868652 make VariableSubsSlice an alias 2021-11-25 20:29:34 +01:00
ayazhafiz
d352d2cdf8 Revert "Include annotation type signatures in Expected struct"
This reverts commit 6e4fd5f06a1ae6138659b0073b4e2b375a499588.

This idea didn't work out because cloning the type and storing it on a
variable still resulted in the solver trying to uify the variable with
the type. When there were errors, which there certainly would be if we
tried to unify the variable with a structure that had nested flex/rigid
vars, the nested flex/rigid vars would inherit those errors, and the
program wouldn't typecheck.

Since the motivation here was to expose the signature type to
`reporting` so that we could modify it with suggestions, we should
instead pass that information along in something analogous to the
`Expected` struct.
2021-11-25 13:24:42 -05:00
ayazhafiz
a8e38172ac Remove redundant refs 2021-11-25 11:22:19 -05:00
ayazhafiz
ee34e79790 Include annotation type signatures in Expected struct
To provide better error messages and suggestions related to changing
type annotations, we now pass annotation type signatures all the way
down through the constraint solver. At constraint generation we
associate the type signature with a unique variable, and during error
reporting, we pull out an `ErrorType` corresponding to the original type
signature, by looking up the unique variable. This gives us two nice
things:

1. It means we don't have to pass the original, AST-like type
   annotation, which can be quite large, to everyone who looks at an
   expectation.
2. It gives us a translation from a `Type` to an `ErrorType` for free
   using the existing translation procedure in `roc_types::subs`,
   without having to create a new translation function.
2021-11-25 11:16:17 -05:00
Richard Feldman
618925fe27
Fix typo in comment 2021-11-24 23:17:24 -05:00
Folkert
093b733a2c add tag name dedup 2021-11-25 00:11:11 +01:00
Folkert
7c2e8cd812 optimize NAT 2021-11-24 23:00:03 +01:00
Folkert
9c551a0276 use insertion sort 2021-11-24 22:55:45 +01:00
Folkert
e0d7c54906 simplify alias insertion 2021-11-24 22:39:42 +01:00
Folkert
4e4f827bb0 simplify function-or-tag-union insertion 2021-11-24 22:11:05 +01:00
Folkert
379abeed26 refactor tag insertion 2021-11-24 21:57:19 +01:00
Folkert
340055fca5 point to empty VariableSubsSlice 2021-11-24 21:57:00 +01:00
Folkert
cb8e9acb92 special-case the closure tags 2021-11-24 21:14:58 +01:00
Folkert
3e640f78bf cleanup 2021-11-24 20:44:51 +01:00
Folkert
308b91153e add faster insertion path for tag unions 2021-11-24 20:38:52 +01:00
Folkert
541dd9777a thread_local experiment 2021-11-24 19:59:53 +01:00
Folkert
f1541d56bd use Entry in some places 2021-11-24 19:45:30 +01:00
Folkert
5e76e3a97e more reserving into subs 2021-11-24 19:14:37 +01:00
Folkert
739ae60b1e clean up usage of reserve_into_subs 2021-11-24 18:52:22 +01:00
Folkert
61f6687dea fix using the wrong length 2021-11-24 18:50:47 +01:00
Folkert
1fbd2a7e7b reserve variable slices 2021-11-24 16:02:55 +01:00
Folkert
a0c9270124 keep track of visited variables in deep_copy_var 2021-11-24 15:14:17 +01:00
Folkert de Vries
6944c900c2
Merge pull request #2065 from rtfeldman/alias-remove-lowercases
Alias remove lowercases
2021-11-23 10:21:05 +01:00
hafiz
682043c16c
Merge pull request #2063 from rtfeldman/type-to-var-prealloc
preallocate variables to prevent extra vector allocations
2021-11-22 20:05:16 -06:00
Folkert
b2aa33f839 Merge remote-tracking branch 'origin/trunk' into alias-remove-lowercases 2021-11-22 21:19:27 +01:00
Folkert
2c1005fdf0 remove lowercases from Content 2021-11-22 21:15:58 +01:00
Folkert
2506875970 preallocate variables to prevent extra vector allocations 2021-11-22 20:17:03 +01:00
hafiz
b3ecc16b16
Merge pull request #2050 from rtfeldman/empty-tags-and-unions
Canonicalize to empty tags and unions
2021-11-22 08:00:07 -06:00
ayazhafiz
1135d88dd0 Add support for type inference at _s in type definitions
All we have to do is introduce a new, unconstrained type variable at
underscore sites, and let the type reconstructor work its magic! The
unconstrained type variable will become a `FlexVar` that absorbs
constraints given to it, so it'll behave like a proper inference
variable. That's it!

Part of #1804
2021-11-21 22:54:45 -05:00
Folkert
8afdf282cb assert that no tag union or record with no fields/tags makes it into Subs 2021-11-21 22:25:03 +01:00
Folkert
594e754e1e manually track visited varibles in deep_copy_var_to 2021-11-20 01:39:57 +01:00
Folkert
2bccc2d28d optimize instantiate_rigids_help 2021-11-20 01:26:17 +01:00
Folkert
497bc2db02 make instantiate_rigids_help use a loop/stack 2021-11-20 00:24:46 +01:00
Folkert
eb9bb12725 bumpalo type_to_var 2021-11-19 19:48:51 +01:00
Folkert
2810c1fc52 clean up instantiate_rigids 2021-11-19 17:51:05 +01:00
Folkert
206c8889df Use StorageSubs for pending specializations 2021-11-19 13:22:17 +01:00
Folkert de Vries
a4fc813ca3
Merge pull request #2002 from rtfeldman/builtins-list-intersperse
Add builtin `List.intersperse`
2021-11-18 22:00:10 +01:00
satotake
ce8a88416d Merge branch 'trunk' into builtins-list-intersperse 2021-11-18 11:16:27 +00:00
Folkert
0199c00936 Merge remote-tracking branch 'origin/trunk' into deep-copy-var-to 2021-11-17 22:34:46 +01:00
Folkert
65e0866d0a add assert; a returned copy must always be in the target subs 2021-11-17 16:32:20 +01:00
Folkert
237d8d1c0b fix the Default instance for subs
we later rely on some variables always existing (numbers, empty record, empty tag union)
but the default instance did not insert those
2021-11-17 16:29:16 +01:00
satotake
16fb04b4fa Add builtin List.intersperse 2021-11-17 15:18:45 +00:00
Folkert
849510c42c WIP 2021-11-16 23:55:11 +01:00
Folkert
7c4300a7a1 clarify what pending means 2021-11-15 22:43:32 +01:00
Folkert
db081cd84b WIP 2021-11-15 20:12:48 +01:00
satotake
73dda714de Add builtin List.split 2021-11-15 13:50:11 +00:00
Folkert de Vries
b3a663a741
Merge branch 'trunk' into builtins-list-sublist 2021-11-10 16:28:58 +01:00
satotake
c0a362dc1a fix solve_expr test 2021-11-10 14:32:22 +00:00
satotake
9f5d3f521b Implement List.sublist 2021-11-10 13:16:57 +00:00
Michael Downey
07cd3850d7
Merge branch 'trunk' into str_trim_left 2021-11-09 19:43:26 -05:00
Michael Downey
eeab43ba13 fixing line for cargo fmt 2021-11-09 15:02:16 -05:00
Michael Downey
1f74fd6856 fixing formatting and adding str_trim_left back to solve_expr 2021-11-09 14:57:35 -05:00
Michael Downey
c0c45f6d39 correct trim to trimLeft in solve_expr 2021-11-09 14:34:24 -05:00
Michael Downey
1bc278d962 initial commit of Str.trimLeft 2021-11-09 14:25:24 -05:00
satotake
772fc9c021 Implement List.takeLast 2021-11-09 12:26:17 +00:00
satotake
878400f95f Implement List.takeFirst 2021-11-08 14:10:53 +00:00
Brendan Hansknecht
73e2cbcb1e Make versions numbers consistent and matching the lock files 2021-11-06 13:24:45 -07:00
Brendan Hansknecht
d49ac68bcc Update dep with major version changes 2021-11-05 19:19:37 -07:00
Brendan Hansknecht
bddc08c977 Remove unused dependencies 2021-11-05 16:58:11 -07:00
Anton-4
a3fc724df3 removed unused maplit 2021-11-03 10:50:25 +01:00
Dan Knutson
352fe90e2d fix format violation 2021-10-26 18:14:04 -05:00
Folkert de Vries
29bd4e3e50
Merge branch 'trunk' into str_trim 2021-10-26 22:45:32 +02:00
Dan Knutson
46365da73a add failing tests
* SIGSEGV for non-empty strings
2021-10-25 20:22:37 -05:00
Chelsea Troy
fc55172219
Fix test typo 2021-10-25 10:45:18 -05:00
Chelsea Troy
49a832d757
Add dropLast to tests and parser 2021-10-21 23:02:26 -05:00
Folkert
4b65430bef fix test 2021-10-17 16:32:45 +02:00
Chelsea Troy
03295d4369 So far, add type for divCeil to the language 2021-10-17 09:29:11 -05:00
Folkert
15a2ac7410 update more List.walk uses 2021-10-10 12:35:52 +02:00
Folkert
94e8c62613 make things compile, base64 has a memory leak 2021-10-06 22:57:11 +02:00
Dan Knutson
700ab20a8c add tests for List.dropAt 2021-10-03 13:55:11 -05:00
Folkert
6d833845f9 fix typo 2021-08-14 00:53:18 +02:00
Folkert
3e448c1b74 get rid of inefficient conversion from mutmap to uniontags 2021-08-14 00:32:01 +02:00
Folkert
4cbb1c9b25 optimize initial tag union creation 2021-08-13 23:53:27 +02:00
Folkert
df83bf0d48 Merge remote-tracking branch 'origin/soa-alias' into alias-nominal-equality 2021-08-13 12:11:36 +02:00
Folkert
c9040c012e make things work 2021-08-13 11:04:31 +02:00
Folkert
42f04fcc77 use variablesubsslice for Apply 2021-08-12 22:49:56 +02:00
Folkert
3bbf1a5506 use UnionTags for recursive tag unions 2021-08-12 20:50:33 +02:00
Folkert
6c0860b6bf milestone all but one gen tests passing 2021-08-11 21:50:11 +02:00
Folkert
0e66995437 Merge remote-tracking branch 'origin/trunk' into tags-soa-phase-0 2021-08-11 17:25:00 +02:00
Folkert
83ad331bb1 remove chase_record_ext_var 2021-08-07 15:35:57 +02:00