Commit graph

36 commits

Author SHA1 Message Date
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
Kevin Sjöberg
87894578cf Remove alignment parameter 2021-11-07 20:48:09 +01:00
Kevin Sjöberg
44938a9e35 Implement List.any 2021-11-07 20:44:10 +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
29e7853b85 use phi node in elem_loop 2021-10-30 22:05:43 +02:00
Folkert
dd38d49335 fix formatting 2021-10-20 19:44:26 +02:00
Folkert
9fc832d8ef new intrinsic approach 2021-10-20 15:18:02 +02:00
Folkert
78c49d3095 support intrinsics/builtins for more integer types 2021-10-19 21:41:38 +02:00
Dan Knutson
65821d6a9f remove giesch/todo tags, add List.drop doc 2021-10-03 13:55:11 -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
Folkert
0690633116 spec for List.reverse 2021-10-03 13:34:09 +02:00
Folkert
13d480d5f3 spec for list append 2021-10-03 13:27:47 +02:00
Folkert
018348bd83 make Str.fromUtf8 in-place 2021-10-03 12:13:17 +02:00
Folkert
dbb8acbe67 add in-place List.swap 2021-10-03 00:25:35 +02:00
Folkert
cd9b32ba65 fix list decref 2021-09-10 21:53:57 +02:00
Folkert
4990e543fa make str/list C abi safe 2021-08-25 20:47:03 +02:00
Folkert
a4475b7544 make TestBase64 compile 2021-08-25 20:47:03 +02:00
Folkert
225c97aae3 move List.prepend to zig 2021-08-14 12:28:05 +02:00
Folkert
899cbeabd7 fix extra ampersands 2021-07-29 17:32:08 +02:00
Folkert
768c59f45d bigger tag size fixes 2021-07-24 13:36:06 +02:00
Folkert
f5e5ec42ad use ptr_int 2021-07-24 12:43:58 +02:00
Folkert
d0be0df83c tweaks 2021-07-24 12:33:57 +02:00
rvcas
fb12715aba chore: list remove unused vars 2021-07-02 18:36:17 -04:00
Folkert
98a9dc0945 remove tag id from data bytes for non-recursive tags 2021-06-26 17:01:23 +02:00
Folkert
fd9b826398 fix the issues 2021-06-25 22:27:11 +02:00
Folkert
0eba188493 WIP 2021-06-24 20:12:37 +02:00
Folkert
f8bdf05f90 has_tag_id from zig 2021-06-24 20:12:05 +02:00
Folkert
27308e98b7 use morphic update mode 2021-06-22 20:53:55 +02:00
Folkert
af4ee51560 get rid of InPlace 2021-06-19 16:56:27 +02:00
Folkert
718aa34b19 clippy 2021-06-19 15:04:28 +02:00
Folkert
f2f9897187 remove FunctionPointer completely 2021-06-19 15:04:28 +02:00
Folkert
cc98237a0a closure_env_layout 2021-06-16 22:15:55 +02:00
Richard Feldman
57676057fa Rename gen to gen_llvm
This way, we have gen_dev and gen_llvm representing the two
different compiler backends.
2021-06-06 07:56:47 -04:00
Renamed from compiler/gen/src/llvm/build_list.rs (Browse further)