zip_list

Package Version Hex Docs

A ZipList is a list-like data structure that maintains a selected element. It provides operations to navigate through the elements, as well as to insert or remove elements.

It is useful for various implementations, such as:

Installation

gleam add zip_list

Usage

import gleam/io
import zip_list

pub fn main() {
    let animals =
        zip_list.new([], "Dog", ["Cat", "Bird", "Fish"])
        |> zip_list.next

    io.println("You selected: " <> zip_list.current(animals)) // => "You selected: Cat"
}

Further documentation can be found at https://hexdocs.pm/zip_list.

Development

gleam run   # Run the project
gleam test  # Run the tests
Search Document