ntreu14/elm-stack/1.1.0

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!"])