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
Folkert
7ff4ad6f7b
fix merge conflict
2021-11-08 23:57:56 +01: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
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
Folkert
e7ec575a81
trying to track down uninitialized memory creation
2021-11-07 21:41:12 +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
3138fc43ec
cosmetic changes
2021-11-07 16:31:43 +01:00
Folkert
0e1e3381f0
Merge remote-tracking branch 'origin/trunk' into tag-union-imitate-rust
2021-11-07 15:29:55 +01:00
Folkert
180575852a
all tests passing
2021-11-07 14:56:24 +01:00
Folkert de Vries
c0c2c1341c
Merge branch 'trunk' into fix-str-from-int
2021-11-07 00:00:21 +01:00
Folkert
bd0f02c542
another waypoint
2021-11-06 19:27:16 +01:00
Kevin Sjöberg
f6d055dc62
Correct minor spelling mistakes
2021-11-06 15:29:08 +01:00
Kevin Sjöberg
c18f306a7e
Remove dead code
2021-11-06 14:55:27 +01:00
Folkert
5cd232816b
waypoint
2021-11-05 21:30:20 +01:00
Folkert
51756cbc89
fix uninitialized alloca
2021-11-05 11:21:06 +01:00
Folkert
e378f0d2f9
fix tags tests
2021-11-05 10:35:17 +01:00
Folkert
2174db6534
Merge remote-tracking branch 'origin/trunk' into tag-union-imitate-rust
2021-11-05 09:28:36 +01: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
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
1d1bd3d051
working, but generates more code
2021-10-22 14:54:15 +02:00
Folkert
2ff3a97ada
re-implement roc returning by pointer
2021-10-22 13:24:18 +02:00
Folkert
171c0836e4
return tag unions by pointer
2021-10-22 13:18:31 +02:00
Folkert
28b15cdf67
prettier
2021-10-22 13:17:07 +02:00
Folkert
7d1bd0ffe7
make refcount take tag union by reference
2021-10-22 13:17:07 +02:00
Folkert
e73ac60053
improve Tag literal generation
2021-10-22 13:17:07 +02:00
Folkert
ad9f0b0609
clippy
2021-10-22 13:07:45 +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
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
Folkert
ab34c2a55e
generalize all number intrinsics
2021-10-20 16:21:57 +02:00