ntreu14 / elm-stack

Simple implementation of a generic Stack data structure in Elm.

Home Page:https://package.elm-lang.org/packages/ntreu14/elm-stack/latest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Stack

An implementation of a generic stack data structure in Elm.

Please file any issues here.

Feedback and contributions are welcome!

Example

A stack is used to represent a Last-In, First-Out (LIFO) collection of values.

Here is a very simple example of a Stack with what the state of the Stack would be along the way:

Stack.empty               -- Stack []
  |> Stack.push "World!"  -- Stack ["World!"]
  |> Stack.push "Hello"   -- Stack ["Hello", "World!"]
  |> Stack.pop            -- (Just "Hello", Stack ["World!"])

About

Simple implementation of a generic Stack data structure in Elm.

https://package.elm-lang.org/packages/ntreu14/elm-stack/latest

License:MIT License


Languages

Language:Elm 100.0%