diff options
author | Louis Pilfold <louis@lpil.uk> | 2023-02-01 17:28:08 +0000 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2023-02-01 17:28:08 +0000 |
commit | 67e9cf8ea21ac829612e6e0ce2488c4748667a2a (patch) | |
tree | 31b3ec74413c54d2482a769d013144491ed6bf17 | |
parent | 9795db26afb557e8b028f62aca1c2f8f6a753658 (diff) | |
download | gleam_stdlib-67e9cf8ea21ac829612e6e0ce2488c4748667a2a.tar.gz gleam_stdlib-67e9cf8ea21ac829612e6e0ce2488c4748667a2a.zip |
Fix changelog
-rw-r--r-- | CHANGELOG.md | 2 | ||||
-rw-r--r-- | src/gleam/map.gleam | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f881fd..e7251eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unreleased +- The `list` module gains the `group` function. - The `dynamic` module is able to decode simple JavaScript objects to maps. So, the behaviour of the `field` and `object` functions are consistent. @@ -25,7 +26,6 @@ `utf_codepoint_to_int` functions. - Fixed `string.inspect`'s escaping of `"`, `\`, `\n`, `\r`, `\r\n`, and `\t`, which in turn fixes `io.debug`'s output of such strings. -- The `list` module gains the `group` function. - The `bit_string` function in the `dynamic` module now knows how to handle JavaScript `Uint8Array`s. diff --git a/src/gleam/map.gleam b/src/gleam/map.gleam index a1b7523..fd9f961 100644 --- a/src/gleam/map.gleam +++ b/src/gleam/map.gleam @@ -265,16 +265,16 @@ if erlang { } if javascript { - fn do_reverse_acc(remaining, accumulator) { + fn reverse_and_concat(remaining, accumulator) { case remaining { [] -> accumulator - [item, ..rest] -> do_reverse_acc(rest, [item, ..accumulator]) + [item, ..rest] -> reverse_and_concat(rest, [item, ..accumulator]) } } fn do_keys_acc(list: List(#(k, v)), acc: List(k)) -> List(k) { case list { - [] -> do_reverse_acc(acc, []) + [] -> reverse_and_concat(acc, []) [x, ..xs] -> do_keys_acc(xs, [x.0, ..acc]) } } @@ -312,7 +312,7 @@ if erlang { if javascript { fn do_values_acc(list: List(#(k, v)), acc: List(v)) -> List(v) { case list { - [] -> do_reverse_acc(acc, []) + [] -> reverse_and_concat(acc, []) [x, ..xs] -> do_values_acc(xs, [x.1, ..acc]) } } |