This is an alternative site for discovering Elm packages. You may be looking for the official Elm package site instead.
A package that implements a bunch of collections
version 1.1.0
license BSD3
native-modules False
elm-version 0.18.0 <= v < 0.19.0
Tag 1.1.0
Committed At 2017-03-23 18:56:03 UTC
elm-lang/html 2.0.0 <= v < 3.0.0 2.0.0
elm-lang/core 5.1.1 <= v < 6.0.0 5.1.1

Modules

README

This library provides a bunch of well know data structure for elm

elm-package install vieiralucas/elm-collections

Stack

empty : Stack a

push : a -> Stack a -> Stack a

top : Stack a -> Maybe a

pop : Stack a -> ( Maybe a, Stack a)

toList : Stack a -> List a

Example

import Stack

main =
    Stack.empty
        |> Stack.push 7
        |> Stack.push 42
        |> Stack.pop |> snd
        |> Stack.top
        |> toString
        |> Html.text
            -- Shows "Just 7"

Queue (FIFO)

empty : Queue a

enq : a -> Queue a -> Queue a

first : Queue a -> Maybe a

deq : Queue a -> ( Maybe a, Queue a)

toList : Queue a -> List a

Example

import Queue

main =
    Queue.empty
        |> Queue.enq 7
        |> Queue.enq 42
        |> Queue.deq |> snd
        |> Queue.first
        |> toString
        |> Html.text
            -- Shows "Just 42"