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
Kevin Sjöberg
0e500ba33c
Document List.any
2021-11-07 20:43:28 +01:00
Kevin Sjöberg
f6d055dc62
Correct minor spelling mistakes
2021-11-06 15:29:08 +01:00
Kevin Sjöberg
f9ed060e49
Implement List.map4
2021-10-31 21:08:41 +01:00
Chelsea Troy
fd83c3b749
Branch the dropLast functionality from dropAt, inserting an index gathered by subtracting 1 from the list length
2021-10-23 00:17:08 -05:00
Richard Feldman
8391c337ab
Merge remote-tracking branch 'origin/trunk' into list-walk-flip
2021-10-05 20:50:50 -04:00
Richard Feldman
894e295b85
Merge pull request #1764 from rtfeldman/list
...
Some List docs changes
2021-10-04 18:08:32 -05:00
Richard Feldman
cfe7d5afbb
Document List.map2 and List.map3
2021-10-04 08:42:52 -04:00
Richard Feldman
e6ec1ded22
Add mapJoin and mapOrDrop to List
2021-10-04 08:26:23 -04: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
Richard Feldman
b4e4ae2ff3
Update docs for List.walk and friends
2021-08-30 22:45:03 -04:00
Richard Feldman
f263b0dba7
True and False aren't links
2021-08-08 23:31:42 -04:00
Richard Feldman
65eaa5b95a
Fix some U8 auto-links
2021-08-08 23:31:03 -04:00
Richard Feldman
ea5da5d477
Add Native to Endi
2021-08-08 23:23:45 -04:00
Richard Feldman
3de0766fe9
Add Result docs
2021-08-08 20:36:52 -04:00
Richard Feldman
2abab84373
Update some map
docs
2021-08-08 20:32:50 -04:00
Richard Feldman
a5929ada4c
Update Dict docs
2021-08-08 20:03:57 -04:00
Richard Feldman
528840acd7
Fix Set docs
2021-08-08 19:59:56 -04:00
Richard Feldman
de5328e286
Fix the Num docs a bunch
2021-08-08 15:56:55 -04:00
Richard Feldman
f62d25e42c
Fix a bunch of List docs
2021-08-08 15:49:36 -04:00
Richard Feldman
277f42cef8
Fix a stray header
2021-08-08 15:29:06 -04:00
Richard Feldman
98682d44ac
Fix some currently-broken links
2021-08-07 23:20:34 -04:00
Richard Feldman
2a616103c6
Rename Str.toBytes to Str.toUtf8
2021-08-07 22:46:24 -04:00
Richard Feldman
77b7913e87
Fix some currently-dead links
2021-08-07 21:46:20 -04:00
Richard Feldman
9b8c34ce95
Only expose Str functions that are actually implemented
2021-08-07 21:46:20 -04:00
Richard Feldman
267836226c
s/CodePoint/CodePt/g
2021-08-07 21:46:20 -04:00
Richard Feldman
69b1497907
Improve Str docs
2021-08-07 21:46:20 -04:00
Richard Feldman
439caaa1ca
Don't use a broken docs link in Bool
2021-08-01 10:23:16 -04:00
Jared Ramirez
d401133edc
Remove Dec docs
2021-06-21 17:02:54 -07:00
Jared Ramirez
5868518758
Add basic Dec.roc docs
2021-06-18 12:50:44 -07:00
Richard Feldman
bec4884028
Try having only one parse function
2021-06-08 21:57:22 -04:00
Richard Feldman
043091b1e6
Revert List.map idea
...
Not convinced this is a good design. Might be, might not be, but needs
further investigation.
2021-06-08 21:38:24 -04:00
Richard Feldman
6446bf8c1a
Update some docs
2021-06-07 21:42:45 -04:00
Anton-4
8a8bbfd10b
fixed dir copying issue, added earthignore, fixed typos, set up typo checking for CI
2021-06-07 14:55:35 +02:00
Anton-4
22d834ebd9
Merge branch 'trunk' of github.com:rtfeldman/roc into typos_ci
2021-06-07 12:33:26 +02:00
Richard Feldman
4995bc2312
Fix some List docs
2021-06-06 02:22:19 -04:00
Richard Feldman
ed3f720dd2
Change some Bool docs
2021-06-05 19:06:40 -04:00
Anton-4
314503cf7f
fixed typos, added typos checking to CI
2021-06-05 20:02:54 +02:00
Richard Feldman
49a85bd946
Drop obsolete docs
2021-06-04 21:27:38 -04:00
Richard Feldman
2b2b6e3ddd
Update some more docs
2021-06-04 21:27:26 -04:00
Richard Feldman
4e9b11afd4
s/0/zero
2021-06-04 08:20:33 -04:00
Richard Feldman
4d65cbf183
Clarify overflow semantics for add/sub/mul
2021-06-04 08:16:37 -04:00
Richard Feldman
7e2afa949e
Document Dict.insert and Set.add panicking on NaN
2021-06-04 08:16:37 -04:00
Richard Feldman
23831e4be1
s/runtime error/panic in docs
2021-06-04 08:16:37 -04:00
Richard Feldman
253f7fed4f
Add some Nat docs.
2021-06-04 08:16:37 -04:00
Richard Feldman
3b1142feb8
Fix some duplicate and missing Num docs
2021-06-04 08:16:37 -04:00
Richard Feldman
87f994039b
Drop Num.hash64
2021-06-04 08:16:37 -04:00
Richard Feldman
db4ce6aef3
Revise some more Num docs.
2021-06-04 08:16:37 -04:00
Richard Feldman
b08c70985a
Remove poison.
2021-06-04 08:16:37 -04:00