Commit graph

489 commits

Author SHA1 Message Date
Brian Carroll
d0f1698db2 Merge branch 'trunk' of github.com:rtfeldman/roc into wasm-link-builtins 2021-11-09 15:08:43 +00: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
1028e1593a Fix unused import 2021-11-08 19:49:33 -08: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
Folkert
a9d483cb60 Merge remote-tracking branch 'origin/trunk' into tag-union-imitate-rust 2021-11-08 22:31:17 +01:00
Folkert
8266284567 clippy 2021-11-08 22:31:08 +01:00
satotake
9087bf7273 Merge branch 'trunk' into builtsins-list-take-first 2021-11-08 14:32:36 +00:00
satotake
878400f95f Implement List.takeFirst 2021-11-08 14:10:53 +00:00
satotake
97c82d8d51 pick 02acef6 2021-11-08 11:15:20 +00:00
satotake
b8340b47c6 checkout trunk 2021-11-08 11:13:17 +00:00
satotake
c8f7a98d74 Merge branch 'trunk' into remove-dict-hash-test-only 2021-11-08 11:12:31 +00:00
Brendan Hansknecht
2ce945771e Make test crates only have dev dependencies and separate out wasm memory helper 2021-11-07 18:01:40 -08:00
Brendan Hansknecht
89781ec50d Stop building test crates as part of non-test builds 2021-11-07 16:28:17 -08:00
Brian Carroll
ce9658684a Move wasmer dependency from gen_wasm to test_wasm 2021-11-07 22:56:28 +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
Folkert
0e1e3381f0 Merge remote-tracking branch 'origin/trunk' into tag-union-imitate-rust 2021-11-07 15:29:55 +01:00
satotake
0b524889c0 fmt 2021-11-07 12:46:11 +00:00
satotake
ad50f4a8f3
Merge branch 'trunk' into remove-dict-hash-test-only 2021-11-07 21:43:04 +09:00
satotake
a12b75192e Hide Dict.hashTestOnly 2021-11-07 12:30:04 +00:00
satotake
0922c86352 Rollback 2021-11-07 12:27:26 +00:00
Kevin Sjöberg
f6d055dc62 Correct minor spelling mistakes 2021-11-06 15:29:08 +01:00
Chelsea Troy
208bce563a
Merge branch 'trunk' into dropfirst-builtin 2021-11-05 23:34:46 -05:00
Folkert
5cd232816b waypoint 2021-11-05 21:30:20 +01:00
Eric Newbury
f3a350dd74 add dropFirst builtin 2021-11-05 16:12:29 -04:00
Folkert
aa9bf6bdff fix alignment problem 2021-11-03 18:21:07 +01:00
satotake
02acef68df remove Dict.hashTestOnly 2021-11-03 14:33:53 +00: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
12d35ba9f1 work around all test strings being static 2021-10-25 20:22:37 -05:00
Dan Knutson
e1b9699272 remove TODO tags 2021-10-25 20:22:37 -05:00
Dan Knutson
ca48d17dbc add Roc-level shared case tests 2021-10-25 20:22:37 -05:00
Dan Knutson
6f7a26895a handle small strings correctly 2021-10-25 20:22:37 -05:00
Dan Knutson
13fd72f3d8 thrashing 2021-10-25 20:22:37 -05:00
Dan Knutson
46365da73a add failing tests
* SIGSEGV for non-empty strings
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
90401477c9 Fix List.walkUntil arg order 2021-10-06 07:32:56 -04:00
Richard Feldman
8391c337ab Merge remote-tracking branch 'origin/trunk' into list-walk-flip 2021-10-05 20:50:50 -04:00
Folkert de Vries
fa4875da83
Merge pull request #1761 from rtfeldman/giesch
Add List.dropAt
2021-10-04 15:01:17 +02:00
Folkert de Vries
3d82369bcd
Merge branch 'trunk' into nested-rigid-introduced-twice 2021-10-03 23:55:23 +02:00