Commit graph

145 commits

Author SHA1 Message Date
Richard Feldman
9b05d8dd50
Move expect zig code out of utils 2022-02-02 19:15:47 -05:00
Chelsea Troy
bf582b8120 Add C implementations for testing functions in zig 2022-01-02 14:55:56 -06:00
Chelsea Troy
b96ebe0457 Starts memory allocation for our collection of failures for the expect keyword
+ BLOCKED: @lucas how do we initialize an empty slice in Zig?
2021-12-12 19:02:18 -06:00
Richard Feldman
1ce648ac27
Merge pull request #2116 from rtfeldman/str_to_num
Str.toNum
2021-12-09 09:48:38 -05:00
rvcas
bc5b1abcba feat(Str.toNum): support decimal 2021-12-02 15:35:34 -05:00
rvcas
d6ab0b6aa4 fix: bitcode functions needed the str namespace not num 2021-12-01 16:40:56 -05:00
Folkert
69fc1ad7e7 sketch of StrToNum 2021-12-01 15:33:16 +01:00
Brian Carroll
6e5acadfea Create new lowlevels for refcounting 2021-11-30 09:57:00 +00:00
Michael Downey
d946b84e63 adding initial List.all 2021-11-16 16:34:36 -05:00
satotake
c253273490 Merge branch 'trunk' into refactor-builtin-list-drop 2021-11-15 11:37:32 +00:00
satotake
8e29daa160 remove low-level List.drop codes 2021-11-15 11:28:38 +00:00
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
Michael Downey
07cd3850d7
Merge branch 'trunk' into str_trim_left 2021-11-09 19:43:26 -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
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
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
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
f9ed060e49 Implement List.map4 2021-10-31 21:08:41 +01:00
Dan Gieschen Knutson
02117ba512
Merge branch 'trunk' into str_trim 2021-10-27 18:01:29 -05:00
Locria Cyber
791c46fe0d Remove deprecated zig features 2021-10-26 20:21:55 -04:00
Dan Knutson
e7523ad41d add Roc wiring 2021-10-25 20:22:37 -05:00
Folkert
a072d8d1b1 fix things 2021-10-20 16:56:04 +02:00
Folkert
63b1aaad4e hook up polymorphic zig builtins 2021-10-20 16:43:39 +02:00
Folkert
bd98ac6dc7 Merge remote-tracking branch 'origin/trunk' into divTruncate 2021-10-19 23:36:03 +02:00
Folkert
78c49d3095 support intrinsics/builtins for more integer types 2021-10-19 21:41:38 +02:00
Folkert
6cc8f8624c a way forward 2021-10-18 11:09:38 +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
Brendan Hansknecht
c334e4d3e5 Export zig builtin version of __muloti4 as weak so it doesn't conflict if it already exists 2021-09-24 08:54:41 -07:00
Richard Feldman
0dd1395331
Merge pull request #1686 from rtfeldman/refcounting-cleanup
Refcounting cleanup
2021-09-11 13:33:36 -04:00
Folkert
8015edccf8 use freestanding as wasm32 builtins target 2021-09-11 15:40:35 +02: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