hstack
A heterogeneous stack data structure for Gleam.
gleam add hstack@1
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
gleam test # Run the tests