Commit graph

710 commits

Author SHA1 Message Date
Agus Zubiaga
7eedd62844
Fix List.splitFirst and List.splitLast docs
The examples in the docs appear to expect `List.splitFirst` to exclude occurrences of the delimiter in the `after` list:
```
List.splitFirst [Foo, Z, Bar, Z, Baz] Z == Ok { before: [Foo], after: [Bar, Baz] }
```
However, only the first occurrence of the delimiter in the `before` list. The `after` list contains everything after the first occurrence of the delimiter.
```
List.splitFirst [Foo, Z, Bar, Z, Baz] Z == Ok { before: [Foo], after: [Bar, Z, Baz] }
```

The same applies to `List.splitLast`

Signed-off-by: Agus Zubiaga <hi@aguz.me>
2023-03-08 10:18:42 -03:00
Luke Boswell
ae6f9067b6
fix Roc formatting 2023-03-08 18:11:49 +11:00
Luke Boswell
890f3db10a
update to support fenced code 2023-03-08 17:30:30 +11:00
Brendan Hansknecht
f42f61e271
run a toml formatter and then clean it up a bit 2023-03-06 19:47:57 -08:00
Brendan Hansknecht
4a89bee0a5
centralize package versions except for vendor and excluded 2023-03-06 19:29:09 -08:00
Brendan Hansknecht
5485c8a5b0
update to using workspace package spec 2023-03-06 16:36:18 -08:00
Luke Boswell
5ead576976
fix indentation for code blocks 2023-03-06 22:32:25 +11:00
Luke Boswell
5933d6b7e7
improve Json test coverage and fix decoding bugs 2023-03-05 17:00:10 +11:00
Luke Boswell
91adf0f411
Merge remote-tracking branch 'origin/main' into builtin-json 2023-03-05 15:58:58 +11:00
Brendan Hansknecht
0aa932d014
fix mem leak in Str.trim and make all Str.trim* functions consistent 2023-03-02 22:18:26 -08:00
Richard Feldman
82663fd30d
Merge pull request #5076 from roc-lang/fix-list-range
Fix List.range crashing
2023-03-01 19:29:24 -05:00
Luke Boswell
58d4faa0da
handle escapes in JSON string decoder 2023-02-28 20:53:57 +11:00
Brendan Hansknecht
c4d56f1dc9
update formatting 2023-02-27 16:43:35 -08:00
Brendan Hansknecht
f77d1dcd6b
fix List.range so that it will only crash when Length is too large 2023-02-27 16:01:05 -08:00
Folkert
44f08f9e47
implement sqrt and log in the dev backend 2023-02-26 21:41:25 +01:00
Luca Cervello
a4410fe052
fix: add spaces around ? in optional record field 2023-02-08 18:41:22 +01:00
David Dunn
550b22c633
Fix unicode escape sequences in Str docs
Unicode characters are escaped like \u(00) instead of \{0x00}. Tested
that this is the same for the repl and the hello world example
`Stdout.line "Hello,\u(0A)World!"`.

Found the correct syntax here:
304768569
2023-01-31 21:39:57 +04:00
Richard Feldman
b5caddcb77
Merge pull request #4973 from roc-lang/fix-string-split
fix string split on overlapping delimiters
2023-01-27 19:34:07 -05:00
Folkert
d52c037cba
fix string split on overlapping delimiters 2023-01-27 17:35:10 +01:00
Ayaz
99050956d3
Merge pull request #4971 from roc-lang/str-trim-null-byte
fix bug in Str.trim
2023-01-27 09:29:01 -06:00
Folkert
a77f137a9d
fix bug in Str.trim 2023-01-26 22:52:14 +01:00
Folkert
0af11c210e
fix memory leak in List.concat 2023-01-26 20:31:33 +01:00
Brian Carroll
a249e14ee5
builtins: restore nicer hash code for Dict 2023-01-23 22:39:24 +00:00
Folkert
4e5b106f98
use capacity instead of length in list deinit 2023-01-20 21:44:41 +01:00
Folkert
165d4b3450
fix memory leak in string trimming 2023-01-19 14:35:38 +01:00
Ayaz
616d699e59
Merge pull request #4894 from roc-lang/list-reserve-zst
handle zero-sized types in list decrement
2023-01-14 19:44:31 -06:00
Ayaz Hafiz
b8712bcb30
Weaken records in let-bindings
This change also means we must update the interface of `Dict.empty` and
`Set.empty` from

```
Dict.empty : Dict k v
```

to

```
Dict.empty : {} -> Dict k v
```
2023-01-14 15:33:51 +01:00
Folkert
437498b7ac
list decrement must use capacity, not length 2023-01-14 13:14:37 +01:00
Folkert
148d24662e
use capacity instead of length in decref 2023-01-08 22:01:35 +01:00
Richard Feldman
ccbd6ad593
Merge pull request #4838 from roc-lang/more-str-docs
Minor `Str` improvements
2022-12-31 01:58:50 -05:00
Richard Feldman
d4baf0ab37
Rename a constant 2022-12-29 20:48:30 -05:00
Folkert
6e2e5600df
conditional compilation fix 2022-12-29 16:50:22 +01:00
Folkert
a2c760aa56
keep conditional compilation local 2022-12-29 16:50:20 +01:00
Ayaz
db86b874e1
Merge pull request #4830 from roc-lang/list-concat-memory-leak
fix memory leak in List.concat
2022-12-28 23:23:05 -06:00
Folkert
05e23f8c5c
decref owned but empty list in List.concat 2022-12-29 00:13:24 +01:00
Folkert
2dfa7d6ef1
fix memory leak in List.concat 2022-12-28 22:52:32 +01:00
Richard Feldman
8606faa9db
Move builtin module-level docs to the top 2022-12-26 23:57:27 -05:00
Richard Feldman
5e3d808a61
roc format 2022-12-24 22:32:15 -05:00
Richard Feldman
39f60be377
Add builtins/main.roc for docs generation 2022-12-24 22:32:14 -05:00
Richard Feldman
4452b06b6d
Fix some builtin docs 2022-12-24 22:32:14 -05:00
Folkert de Vries
3682e7db6c
Merge pull request #4796 from roc-lang/str-rc-fixes
fix missing decref in split and concat
2022-12-22 12:00:53 +01:00
Folkert
1481aea40c
fix missing decref in split and concat 2022-12-22 01:08:31 +01:00
Folkert
6c7d434f81
fix lifetime issue in RocStr.asU8Ptr 2022-12-21 01:43:38 +01:00
Folkert de Vries
a18197347b
Merge pull request #4767 from roc-lang/wasm_interp_repl_test
Replace Wasmer with roc_wasm_interp
2022-12-18 20:44:58 +01:00
Folkert
1d260530fb
print a prettier command string 2022-12-17 22:21:00 +01:00
Folkert
a522d49558
backport some changes needed for zig 10 2022-12-17 22:17:27 +01:00
Brian Carroll
62269bf6c9
builtins: build the Wasm interpreter from inside run-wasm-tests.sh 2022-12-16 16:05:00 +00:00
Brian Carroll
d389601035
Merge branch 'main' of github.com:roc-lang/roc into wasm_interp_test_gen 2022-12-16 14:50:09 +00:00
Folkert
d287eafa3a
remove F128 2022-12-14 23:28:38 +01:00
Brian Carroll
f55fbaad12
builtins: use roc_wasm_interp for Zig wasm tests 2022-12-14 12:09:31 +00:00