stdlib
stdlib copied to clipboard
🎁 Gleam's standard library
Read the tin! The replace functions were all replace all style by default and there was no option at all to just replace the first occurrence. This rectifies that for...
Running the following on the Gleam language tour results in 'too much recursion' error `import gleam/iterator pub fn main() { iterator.range(1,6000) |> iterator.try_fold(0, fn(acc, i) { Ok(acc+i) }) } `...
I found myself wanting to print out a dictionary with the keys mapped to a string representation (not just through `string.inspect`) for easier readability. However, the `dict` module only provides...
## Context Given that 1. the `decode` API is [used with formats like JSON](https://github.com/gleam-lang/json), where there is no distinction between floats and ints, and 2. the target (Erlang vs ES)...
Some binary protocols (for example [ID3](https://id3.org/)) use UTF-16 encoded text, which right now must be manually converted to a string. It could be useful to have `bit_array.to_string_utf16` function to perform...
Maybe it would be nice to have QoL function to toggle the key: ``` pub fn toggle(set: set.Set(a), key: a) { case set.contains(set, key) { True -> set.delete(set, key) False...
Couple of fixes to the documentation for the `decode` module: - ~~Replaced `assert` with `let assert` as the former is not currently valid Gleam code.~~ - ~~I did this work...
What @joshi-monster proposed [here](https://github.com/gleam-lang/stdlib/pull/802) Joshi brings up some good points, I'd like to discuss this more
Fixes #797. The separate version of the function for the JavaScript target is a little bit of an eyesore, but can be removed at some future date once `utf_codepoint` pattern...
Hello, This PR solves issue #568 and also adds a `split` function. Both `split` and `split_once` functions as their counterparts in the the `gleam/string` module, and have feature parity across...