/elm-fifo

first in, first out (FIFO) queue

Primary LanguageElm

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

elm-package 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 |> snd
    |> Fifo.remove |> fst
    |> toString
    |> Html.text
        -- Shows "Just 42"