[{"name":"Queue","comment":" One way queue with time-complexity of enqueueing and dequeueing O(1) even at worst case.\n\n\n# Type\n\n@docs Queue\n\n\n# Creation\n\n@docs empty, fromListLIFO, fromListFIFO\n\n\n# Query\n\n@docs isEmpty, head, length\n\n\n# Modification\n\n@docs enqueue, dequeue\n\n\n# Deconstruction\n\n@docs toListLIFO, toListFIFO\n\n","unions":[{"name":"Queue","comment":" Representation of First-In, First-Out(FIFO) data structure.\n","args":["a"],"cases":[]}],"aliases":[],"values":[{"name":"dequeue","comment":" Returns queue without the oldest element of the given queue.\n\n        empty\n            |> enqueue \"e\"\n            |> enqueue \"l\"\n            |> enqueue \"m\"\n            |> enqueue \"i\"\n            |> enqueue \"s\"\n            |> enqueue \"h\"\n            |> dequeue\n            |> head\n        --> Just \"l\"\n\n","type":"Queue.Queue a -> Queue.Queue a"},{"name":"empty","comment":" Returns empty queue.\n\n       head empty == Nothing\n\n","type":"Queue.Queue x"},{"name":"enqueue","comment":" Returns the queue as second argument with the element as the first argument injected into the rear side.\n\n        empty\n            |> enqueue 100\n            |> enqueue 200\n            |> head\n        --> Just 100\n\n","type":"x -> Queue.Queue x -> Queue.Queue x"},{"name":"fromListFIFO","comment":" Create queue from list.\nThe oldest element of the list comes head of the queue.\n\n        [\"H\"]\n            |> (::) \"e\"\n            |> (::) \"l\"\n            |> (::) \"l\"\n            |> (::) \"o\"\n            |> fromListFIFO\n            |> head\n        --> Just \"H\"\n\n","type":"List.List x -> Queue.Queue x"},{"name":"fromListLIFO","comment":" Create queue from list.\nThe newest element comes head of the queue.\n\n        [\"H\",\"e\",\"l\",\"l\",\"o\"]\n            |> fromListLIFO\n            |> head\n        --> Just \"H\"\n\n","type":"List.List x -> Queue.Queue x"},{"name":"head","comment":" Returns the oldest element injected in the queue wrapped in `Maybe`.\n\n        empty\n            |> head\n        --> Nothing\n\n        empty\n            |> enqueue \"e\"\n            |> enqueue \"l\"\n            |> enqueue \"m\"\n            |> head\n        --> Just \"e\"\n\n","type":"Queue.Queue a -> Maybe.Maybe a"},{"name":"isEmpty","comment":" Returns `True` if the argument has no element.\n\n        empty\n            |> enqueue \"a\"\n            |> isEmpty\n        --> False\n\n        empty\n            |> enqueue \"a\"\n            |> dequeue\n            |> isEmpty\n        --> True\n\n","type":"Queue.Queue x -> Basics.Bool"},{"name":"length","comment":" Returns how many elements is contained in the queue.\n\n        empty\n            |> length\n            --> 0\n\n        empty\n            |> enqueue 1\n            |> enqueue 2\n            |> enqueue 3\n            |> dequeue\n            |> length\n            --> 2\n\n","type":"Queue.Queue x -> Basics.Int"},{"name":"toListFIFO","comment":" Convert a queue to List. The first element in the queue will become the head of the returned list.\n\n        empty\n            |> enqueue 100\n            |> enqueue 200\n            |> enqueue 300\n            |> toListFIFO\n        --> [100,200,300]\n\n","type":"Queue.Queue x -> List.List x"},{"name":"toListLIFO","comment":" Convert a queue to List. The last element in the queue will become the head of the returned list.\n\n        empty\n            |> enqueue 100\n            |> enqueue 200\n            |> enqueue 300\n            |> toListLIFO\n        --> [300,200,100]\n\n","type":"Queue.Queue x -> List.List x"}],"binops":[]}]