avh4/elm-fifo - version: 1.0.4

for more information visit the package's GitHub page

Package contains the following modules:

A first-in, first-out queue (FIFO) backed by lists.

elm install avh4/elm-fifo

Basic API

empty : Fifo a

insert : a -> Fifo a -> Fifo a

remove : Fifo a -> (Maybe a, Fifo a)

Example

import Fifo

main =
    Fifo.empty
    |> Fifo.insert 7
    |> Fifo.insert 42
    |> Fifo.remove |> Tuple.second -- gets the updated queue
    |> Fifo.remove |> Tuple.first -- gets the value at the top
    |> Debug.toString
    |> Html.text
        -- Shows "Just 42"