Packages

A heterogeneous stack data structure for Gleam.

Current section

Files

Jump to
hstack README.md
Raw

README.md

# hstack
[![Package Version](https://img.shields.io/hexpm/v/hstack)](https://hex.pm/packages/hstack)
[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/hstack/)
A heterogeneous stack data structure for Gleam.
```sh
gleam add hstack@1
```
```gleam
import hstack
import gleam/function
pub fn main() -> Nil {
hstack.new()
|> hstack.push(1)
|> hstack.push("Hello")
|> hstack.push(2.5)
|> hstack.pop
|> function.tap(echo hstack.get) // --> "Hello"
|> hstack.push(True)
|> hstack.size // --> 3
Nil
}
```
Further documentation can be found at <https://hexdocs.pm/hstack>.
## Development
```sh
gleam test # Run the tests
```