Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mrdimosthenis/gleam_zlists
A library for working with lazy lists in Gleam
https://github.com/mrdimosthenis/gleam_zlists
beam erlang functional-programming gleam gleam-lang
Last synced: 23 days ago
JSON representation
A library for working with lazy lists in Gleam
- Host: GitHub
- URL: https://github.com/mrdimosthenis/gleam_zlists
- Owner: mrdimosthenis
- Created: 2021-02-24T12:34:16.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-05-17T07:11:43.000Z (over 2 years ago)
- Last Synced: 2024-03-14T21:20:19.163Z (9 months ago)
- Topics: beam, erlang, functional-programming, gleam, gleam-lang
- Language: Gleam
- Homepage: https://hexdocs.pm/gleam_zlists/gleam_zlists.html
- Size: 54.7 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-gleam - gleam_zlists - [📚](https://hexdocs.pm/gleam_zlists/) - A library for working with lazy lists in Gleam (Packages / Data Structures)
README
# gleam_zlists
A library for working with **lazy lists** in **Gleam**.
It is a wrapper for [vjache/erlang-zlists](https://github.com/vjache/erlang-zlists), enriched with more functions.
The documentation is available on [HexDocs](https://hexdocs.pm/gleam_zlists/gleam_zlists.html).
## Installation
Add `gleam_zlists` to your Gleam project.
```
gleam add gleam_zlists
```## Examples
```gleam
import gleam_zlists as zlist[2, 4, 6]
|> zlist.of_list
|> zlist.all(int.is_even)
// True[1, 2, 3]
|> zlist.of_list
|> zlist.reverse
|> zlist.to_list
// [3, 2, 1]["a", "b", "c"]
|> zlist.of_list
|> zlist.with_index
|> zlist.to_list
// [#("a", 0), #("b", 1), #("c", 2)]
```