coreyhaines / elm-fifo

first in, first out (FIFO) queue

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.first
    |> Fifo.remove |> Tuple.second
    |> Debug.toString
    |> Html.text
        -- Shows "Just 42"

About

first in, first out (FIFO) queue

License:MIT License


Languages

Language:Elm 100.0%