mhoare/elm-stack/2.1.0

NOTE: this package is not compatible with Elm 0.19.1

Stack

This library implements a stack data structure in Elm, allowing you to worry more about your business logic and less about implementing common adts.

Definition

type Stack a
    The Stack type uses an array to represent the stack.

Common Helpers

initialise : a -> Int -> Stack a
    Initialises a stack given an initialisation value and a stack size.
pop : Stack (Maybe a) -> ( Maybe a, Stack (Maybe a) )
    Removes the item at the top of the stack and returns it as the first item of a tuple.
push : a -> Stack (Maybe a) -> Stack (Maybe a)
    Pushes an item onto the stack and returns the new stack. The item must be of the same type as the stack.
toList : Stack (Maybe a) -> List (Maybe a)

Convert a Stack type to a list data type