Commit graph

85 commits

Author SHA1 Message Date
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
ayazhafiz
ed64ff912a Implement List.dropIf
This was referenced in the `List` documentation and in the
[tutorial](./TUTORIAL.md), but wasn't actually implemented prior to this
commit!

Part of #2227
2021-12-22 12:34:48 -06:00
ayazhafiz
3c2822224a Update expected failure tests to use expect_runtime_error_panic 2021-12-22 09:23:50 -06:00
rvcas
14e66de0b7 tests(wasm): assert_concat_work needs a feature flag too 2021-12-17 12:52:55 -05:00
rvcas
a18c3e2c3a tests(wasm): fix tests 2021-12-17 12:44:11 -05:00
rvcas
edd3c8c4c1 tests(wasm): List.isEmpty already works now 2021-12-17 12:05:17 -05:00
rvcas
660c3dc111 tests(wasm): prep tests for CI 2021-12-17 11:47:58 -05:00
rvcas
40da207859 feat(wasm): LowLevel::ListLen 2021-12-16 21:50:12 -05:00
rvcas
6ada59d7a1 feat(wasm): the beginnings of a real array 2021-12-10 14:44:19 -05:00
rvcas
6305947b1a fix: exclude gen-dev from gen_list test compilation 2021-11-29 18:08:12 -05:00
rvcas
7657d5b192 test: enable wasm in gen_list 2021-11-29 15:06:45 -05:00
Folkert
79d5c82dfb cleanup 2021-11-27 16:36:43 +01:00
Michael Downey
d11bb93539
Merge branch 'trunk' into add_list_all 2021-11-18 16:09:24 -05:00
Michael Downey
9d587d37b4
Merge branch 'trunk' into add_list_all 2021-11-18 06:41:08 -05:00
satotake
ce8a88416d Merge branch 'trunk' into builtins-list-intersperse 2021-11-18 11:16:27 +00:00
Michael Downey
c5484a9ad3 fixing List.all on empty list to be true 2021-11-17 22:47:49 -05:00
satotake
16fb04b4fa Add builtin List.intersperse 2021-11-17 15:18:45 +00:00
Michael Downey
81f0f46132 fixing test 2021-11-16 18:25:16 -05:00
Michael Downey
d946b84e63 adding initial List.all 2021-11-16 16:34:36 -05:00
satotake
73dda714de Add builtin List.split 2021-11-15 13:50:11 +00:00
Folkert
5d7b4b7ad0 change roc call result; adding an extra field for the error message pointer
When the returned value was smaller than a pointer, there was no space for the error message pointer.
2021-11-10 22:14:54 +01:00
satotake
9f5d3f521b Implement List.sublist 2021-11-10 13:16:57 +00:00
Folkert
94efbd0e95 Merge remote-tracking branch 'origin/trunk' into builtins-list-take-last 2021-11-09 16:18:19 +01:00
satotake
dfc527ecff Merge branch 'trunk' into builtins-list-take-last 2021-11-09 12:34:58 +00:00
satotake
772fc9c021 Implement List.takeLast 2021-11-09 12:26:17 +00:00
Folkert
960733c605 Merge remote-tracking branch 'origin/trunk' into builtin/List.find 2021-11-09 13:07:47 +01:00
Brendan Hansknecht
360974398a Merge test_dev, test_wasm, and test_wasm_util into test_gen 2021-11-08 19:31:20 -08:00
ayazhafiz
f65b174ab5 Implement List.find
`List.find : List elem, (elem -> Bool) -> Result elem [ NotFound ]*`
behaves as follows:

```
>>> List.find [1, 2, 3] (\n -> n > 2)
Ok 2
>>> List.find [1, 2, 3] (\n -> n > 4)
Err NotFound
```

We implement this as builtin in two phases. First, we call out to a
pure-llvm-lowlevel `ListFindUnsafe` that returns a record indicating
whether a satisfying element was found, and the value of that element
(the value is all null bytes if the element wasn't found). Then, we lift
that record to a `Result` via a standard construction of the can AST.

Closes #1909
2021-11-08 21:03:14 -05:00
satotake
878400f95f Implement List.takeFirst 2021-11-08 14:10:53 +00:00
Kevin Sjöberg
dfe3f045bd Ignore broken test case for now 2021-11-07 20:48:09 +01:00
Kevin Sjöberg
5e1a9832cb Return false in case of empty list 2021-11-07 20:47:09 +01:00
Kevin Sjöberg
44938a9e35 Implement List.any 2021-11-07 20:44:10 +01:00
ayazhafiz
0d2ed76334 Implement List.joinMap
Closes #1887
2021-11-07 11:08:20 -05:00
Chelsea Troy
208bce563a
Merge branch 'trunk' into dropfirst-builtin 2021-11-05 23:34:46 -05:00
Eric Newbury
f3a350dd74 add dropFirst builtin 2021-11-05 16:12:29 -04:00
Richard Feldman
0bc3ff4ca5 Use std and core over libc where equivalent 2021-11-02 19:37:05 -04:00
Kevin Sjöberg
f9ed060e49 Implement List.map4 2021-10-31 21:08:41 +01:00
Chelsea Troy
4afaf96aea
Add List.max builtin 2021-10-30 19:17:35 -05:00
Folkert de Vries
aa978ae6d9
Merge branch 'trunk' into list_min 2021-10-28 20:32:27 +02:00
Tim Whiting
c721a1cc1f add builtin List.min 2021-10-27 20:28:34 -06:00
Folkert de Vries
29bd4e3e50
Merge branch 'trunk' into str_trim 2021-10-26 22:45:32 +02:00
Dan Knutson
ca48d17dbc add Roc-level shared case tests 2021-10-25 20:22:37 -05:00
Chelsea Troy
49a832d757
Add dropLast to tests and parser 2021-10-21 23:02:26 -05:00
Folkert
94e8c62613 make things compile, base64 has a memory leak 2021-10-06 22:57:11 +02:00
Richard Feldman
8391c337ab Merge remote-tracking branch 'origin/trunk' into list-walk-flip 2021-10-05 20:50:50 -04:00
Dan Knutson
25215cb3e3 cleanup mutable case, split test 2021-10-03 14:09:07 -05:00
Dan Knutson
2a72439117 WIP adding unique mutable case 2021-10-03 13:55:11 -05:00
Dan Knutson
d1ee9c90b2 fix copy/paste error in test 2021-10-03 13:55:11 -05:00
Dan Knutson
700ab20a8c add tests for List.dropAt 2021-10-03 13:55:11 -05:00
Folkert
f43c10373f represent empty closure as unit (not void) 2021-09-24 15:41:00 +02:00