Theo Felippe
8d7c252fce
implemented Str.trimRight
2021-11-13 18:02:58 +00:00
satotake
9ec2bc7946
Remove takeFirst
and takeLast
from backend
2021-11-13 06:03:18 +00:00
satotake
98d2c57edf
move List.sublist to backend
2021-11-13 04:57:28 +00:00
Folkert de Vries
eb1b6d97bf
Merge branch 'trunk' into str_trim_left
2021-11-10 14:06:01 +01:00
Michael Downey
07cd3850d7
Merge branch 'trunk' into str_trim_left
2021-11-09 19:43:26 -05:00
Folkert
a9ce02799c
WIP
2021-11-09 21:37:56 +01: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
878400f95f
Implement List.takeFirst
2021-11-08 14:10:53 +00:00
Richard Feldman
79080fb3f2
Merge pull request #1907 from rtfeldman/cleanup-zig-artifact-gen
...
generate wasm32 object file containing the builtins
2021-11-07 23:43:47 +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
44938a9e35
Implement List.any
2021-11-07 20:44:10 +01:00
Folkert
75c090fd24
cleanup
2021-11-06 23:57:21 +01:00
Kevin Sjöberg
491a480371
Implement Str.fromInt for any integer type
2021-11-06 14:55:27 +01:00
Kevin Sjöberg
f9ed060e49
Implement List.map4
2021-10-31 21:08:41 +01:00
Dan Knutson
e7523ad41d
add Roc wiring
2021-10-25 20:22:37 -05:00
Folkert
76e26e47f3
more cleanup
2021-10-20 17:05:59 +02:00
Folkert
63b1aaad4e
hook up polymorphic zig builtins
2021-10-20 16:43:39 +02:00
Folkert
ab34c2a55e
generalize all number intrinsics
2021-10-20 16:21:57 +02:00
Folkert
9fc832d8ef
new intrinsic approach
2021-10-20 15:18:02 +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
Dan Knutson
3baff93a97
add first version of List.dropAt
...
* adds an implementation with no uniqueness/mutability
2021-10-03 13:55:11 -05:00
Kofi Gumbs
b32a42f05a
Add Str.repeat builtin
2021-09-29 17:32:42 -04:00
Folkert
5e68d31afc
expose decref_pointer_check_NULL
2021-09-10 20:42:25 +02:00
Folkert
5cb7dbd3cc
use zig's decref instead of an LLVM implementation
2021-09-01 16:58:05 +02:00
Folkert de Vries
86d46825aa
Merge branch 'trunk' into NumBytesTo
2021-08-20 11:32:20 +02:00
Joshua Hoeflich
b57ebb6229
Remove castToNat
2021-08-19 16:11:21 -05:00
Joshua Hoeflich
92da003fba
Adds castToNat
2021-08-18 11:02:20 -05:00
Joshua Hoeflich
7068da7144
Merge trunk
2021-08-17 08:47:40 -05:00
Folkert
5171d181ac
emit invoke again to see what's up here
2021-08-16 20:44:55 +02:00
Joshua Hoeflich
1c6ac84f2f
Add Num.round to dev backend
2021-08-15 17:50:07 -05:00
Folkert
a0a0896622
a working prototype
2021-08-15 23:20:05 +02:00
Joshua Hoeflich
22e781259d
TODO: Actually implement the functions
2021-08-14 19:28:13 -05:00
Joshua Hoeflich
ff2c3d7945
Dummy implementation that doesn't do what we want
2021-08-14 17:59:53 -05:00
Folkert
225c97aae3
move List.prepend to zig
2021-08-14 12:28:05 +02:00
Joshua Hoeflich
c00d400d85
Fixes merge conflict
2021-08-08 21:38:15 -05:00
Joshua Hoeflich
4231b340ee
Glue code working
2021-08-08 11:06:10 -05:00
Richard Feldman
2a616103c6
Rename Str.toBytes to Str.toUtf8
2021-08-07 22:46:24 -04:00
Richard Feldman
267836226c
s/CodePoint/CodePt/g
2021-08-07 21:46:20 -04:00
Folkert
23ea151d5f
make decimal math ops correctly report overflow
2021-07-18 22:04:32 +02:00
Folkert
bba1d1b4fe
Merge remote-tracking branch 'origin/trunk' into add-dec-types
2021-06-27 16:26:20 +02:00
Jared Ramirez
ecb89da7b8
Add basic Dec operations
2021-06-25 10:25:03 -07:00
Jared Ramirez
0827123c88
Adding Decimals work!!
2021-06-24 11:15:52 -07:00
Folkert
27308e98b7
use morphic update mode
2021-06-22 20:53:55 +02:00
Richard Feldman
5b91de40db
Only include_bytes when actually building
2021-06-06 00:51:17 -04:00
tarjei
107822a5cc
Add plumbing for List.swap
2021-05-29 21:30:16 +02:00
Richard Feldman
829edd509c
Include builtins.bc in the roc binary
2021-05-26 20:45:27 -04:00
Folkert
2e8a246095
Merge remote-tracking branch 'origin/trunk' into zig-list-set
2021-05-23 16:28:20 +02:00