Skip to content

first in, first out (FIFO) queue

License

Notifications You must be signed in to change notification settings

fluidfractal/elm-fifo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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"

About

first in, first out (FIFO) queue

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Elm 100.0%