Commit Graph

619 Commits

Author SHA1 Message Date
Theo Felippe
84af26d813 added placeholder implementation 2021-11-11 19:13:42 +00:00
Folkert
33e8f9a6b7 Merge remote-tracking branch 'origin/trunk' into cleanup-im-dependency 2021-11-10 17:19:54 +01:00
Folkert de Vries
b3a663a741
Merge branch 'trunk' into builtins-list-sublist 2021-11-10 16:28:58 +01:00
Folkert
5632e3159d remove im dependency where not needed 2021-11-10 16:00:22 +01: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
7e074d300e cleaning up and adding comments 2021-11-09 14:37:31 -05:00
Michael Downey
1bc278d962 initial commit of Str.trimLeft 2021-11-09 14:25:24 -05:00
Folkert
94efbd0e95 Merge remote-tracking branch 'origin/trunk' into builtins-list-take-last 2021-11-09 16:18:19 +01:00
satotake
772fc9c021 Implement List.takeLast 2021-11-09 12:26:17 +00:00
ayazhafiz
074c2ca398 Remove stale DICT_TEST_HASH reference 2021-11-08 21:04:59 -05: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
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
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
Brendan Hansknecht
73e2cbcb1e Make versions numbers consistent and matching the lock files 2021-11-06 13:24:45 -07:00
Anton-4
69f6ffadab
Merge branch 'trunk' into deps 2021-11-06 18:07:34 +01:00
Kevin Sjöberg
f6d055dc62 Correct minor spelling mistakes 2021-11-06 15:29:08 +01:00
Richard Feldman
3df3e2f0d5
Merge branch 'trunk' into deps 2021-11-06 07:19:02 -04:00
Chelsea Troy
208bce563a
Merge branch 'trunk' into dropfirst-builtin 2021-11-05 23:34:46 -05: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
Eric Newbury
f3a350dd74 add dropFirst builtin 2021-11-05 16:12:29 -04:00
Folkert
c5005d3dd1 Merge remote-tracking branch 'origin/trunk' into partialproc-by-reference 2021-11-03 15:32:39 +01:00
Folkert
bc71cf53d6 simplify capturing closure IR gen 2021-11-03 14:26:14 +01:00
Folkert
a15183a7d1 refactor 2021-11-03 14:09:04 +01:00
Anton-4
a3fc724df3 removed unused maplit 2021-11-03 10:50:25 +01:00
Kevin Sjöberg
3fbb081f75 Correct comment of List.map3 signature 2021-10-31 21:08:41 +01: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
329c035e24 fix comment 2021-10-27 20:31:07 -06: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
7ed37bf544 use lowlevel_n helper 2021-10-25 20:22:37 -05:00
Dan Knutson
e1b9699272 remove TODO tags 2021-10-25 20:22:37 -05:00
Dan Knutson
e7523ad41d add Roc wiring 2021-10-25 20:22:37 -05:00
Chelsea Troy
789cc5acc0
cargo fmt 2021-10-25 00:28:50 -05:00
Chelsea Troy
063d7b178b
Figured out why dropLast call was producing an argument mismatch:
- Although list_drop_last's LowLevel operation modeling (body) was correct, the defn() CALLED that body with an extra argument for index (a copy-paste error from dropAt).
- List.dropAt works now :)
2021-10-25 00:06:37 -05:00
Chelsea Troy
9633a5adaa
Fix the build, but List.dropLast itself still doesn't work. 2021-10-23 00:29:13 -05:00
Chelsea Troy
fd83c3b749
Branch the dropLast functionality from dropAt, inserting an index gathered by subtracting 1 from the list length 2021-10-23 00:17:08 -05:00
Folkert
4152519bfb formatting & catch zig overflow error 2021-10-17 18:03:40 +02:00
Chelsea Troy
0cc6e44d35
Thread through the divCeil implementation from Zig:
+ OPEN QUESTION: Evidently the Zig implementation can throw an overflow error. Do we want to do something in Roc to fix this?
2021-10-17 10:46:16 -05:00
Richard Feldman
a0887da6ca
Merge pull request #1645 from rtfeldman/list-walk-flip
Reorder List.walk arguments
2021-10-10 08:38:20 -04: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
Anton-4
ab665b7380 Merge branch 'trunk' of github.com:rtfeldman/roc into docs_markup 2021-10-05 11:58:45 +02:00