Commit graph

310 commits

Author SHA1 Message Date
Folkert
acb26002c8 fix repl 2021-11-10 23:36:16 +01: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
Folkert
33e8f9a6b7 Merge remote-tracking branch 'origin/trunk' into cleanup-im-dependency 2021-11-10 17:19:54 +01:00
Folkert
2262dcb3f9 clean up some other dependencies 2021-11-10 16:25:03 +01:00
Folkert
5632e3159d remove im dependency where not needed 2021-11-10 16:00:22 +01:00
Michael Downey
07cd3850d7
Merge branch 'trunk' into str_trim_left 2021-11-09 19:43:26 -05:00
Michael Downey
c1a48c0a9a fixing line for cargo fmt 2021-11-09 15:11:36 -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
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
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
d0b09e1922 cleanup unused args 2021-11-08 14:31:34 +00:00
satotake
878400f95f Implement List.takeFirst 2021-11-08 14:10:53 +00:00
Richard Feldman
0a347456ef
Merge pull request #1903 from rtfeldman/fix-str-from-int
Implement Str.fromInt for any integer type
2021-11-07 23:42:59 +00:00
Kevin Sjöberg
87894578cf Remove alignment parameter 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
Folkert de Vries
c0c2c1341c
Merge branch 'trunk' into fix-str-from-int 2021-11-07 00:00:21 +01: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
Kevin Sjöberg
491a480371 Implement Str.fromInt for any integer type 2021-11-06 14:55:27 +01:00
Kevin Sjöberg
c18f306a7e Remove dead code 2021-11-06 14:55:27 +01: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
Richard Feldman
ac42470c81 Drop unused libc deps 2021-11-02 19:37:38 -04:00
Richard Feldman
4e19320982
Merge branch 'trunk' into false-cleanup 2021-11-01 22:30:45 -04:00
Kevin Sjöberg
f9ed060e49 Implement List.map4 2021-10-31 21:08:41 +01:00
Folkert
27e70b03e0 cleanup 2021-10-30 22:20:14 +02:00
Folkert
36496662d2 add comment on uninitialized memory 2021-10-30 22:14:26 +02:00
Folkert
29e7853b85 use phi node in elem_loop 2021-10-30 22:05:43 +02:00
Folkert
44e8fbc203 construct tag in alloca (to eventually pass them by pointer) 2021-10-30 22:05:22 +02:00
Dan Gieschen Knutson
02117ba512
Merge branch 'trunk' into str_trim 2021-10-27 18:01:29 -05:00
Folkert
d561f2661d speedups 2021-10-27 00:01:21 +02:00
Dan Knutson
e7523ad41d add Roc wiring 2021-10-25 20:22:37 -05:00
Folkert
ad9f0b0609 clippy 2021-10-22 13:07:45 +02:00
Folkert
da3787feb8 Merge remote-tracking branch 'origin/trunk' into remove-call-result-again 2021-10-22 12:57:36 +02:00
Folkert
10b9307ab6 centralize calling roc functions in llvm 2021-10-22 12:56:58 +02:00
Folkert
e6edfda9a5 refactor call to roc function 2021-10-22 12:32:37 +02:00
Folkert
83de4b55ef remove another instance of RocCallResult 2021-10-22 12:26:04 +02:00
Folkert
0a12ce896f Revert "make list inc/dec non-recursive (except when freeing the list)"
This reverts commit 19eadbfe70.
2021-10-21 20:28:32 +02:00
Folkert
03144f978f Revert "clippy"
This reverts commit 7773cf9b4d.
2021-10-21 20:28:18 +02:00
Folkert
dd38d49335 fix formatting 2021-10-20 19:44:26 +02:00
Folkert
76e26e47f3 more cleanup 2021-10-20 17:05:59 +02:00
Folkert
7735ca21ea cleanup 2021-10-20 17:03:55 +02:00
Folkert
f8dec9453b make things static again 2021-10-20 16:58:25 +02:00
Folkert
63b1aaad4e hook up polymorphic zig builtins 2021-10-20 16:43:39 +02:00