[{"name":"Queue","comment":"\n\n@docs Queue\n\n\n# Construct\n\n@docs empty, fromList\n\n\n# Query\n\n@docs isEmpty, peek\n\n\n# Modify\n\n@docs enqueue, dequeue\n\n\n# Convert\n\n@docs toList\n\n","unions":[{"name":"Queue","comment":" A linear data structure where elements are added to the back (**enqueue**) and removed from the front (**dequeue**).\n","args":["a"],"cases":[]}],"aliases":[],"values":[{"name":"dequeue","comment":" Remove and return the first element added to the queue.\n\n    dequeue empty == Nothing\n\n    dequeue (enqueue 1 empty) == Just ( 1, empty )\n\n    dequeue (enqueue 2 (fromList [ 1 ])) == Just ( 1, fromList [ 2 ] )\n\nThe worst-case time is `O(n)`. However, a sequence of `n` enqueue and dequeue operations\nstarting from an empty queue has a total running time of `O(n)`. Therefore,\nthe amortized time per operation is `O(1)`.\n\n","type":"Queue.Queue a -> Maybe.Maybe ( a, Queue.Queue a )"},{"name":"empty","comment":" The empty queue.\n","type":"Queue.Queue a"},{"name":"enqueue","comment":" Add an element to the back of the queue.\n\n    toList (enqueue 1 empty) == [ 1 ]\n\n    toList (enqueue 2 (fromList [ 1 ])) == [ 1, 2 ]\n\nThe worst-case time is `O(1)`.\n\n","type":"a -> Queue.Queue a -> Queue.Queue a"},{"name":"fromList","comment":" Create a queue from a list.\n","type":"List.List a -> Queue.Queue a"},{"name":"isEmpty","comment":"\n\n    isEmpty empty == True\n\n    isEmpty (fromList []) == True\n\n    isEmpty (fromList [ 1 ]) == False\n\n","type":"Queue.Queue a -> Basics.Bool"},{"name":"peek","comment":" Get the first element added to the queue without modifying the queue.\n\n    peek empty == Nothing\n\n    peek (fromList [ 1, 2, 3 ]) == Just 1\n\n    peek (enqueue 3 (enqueue 2 (enqueue 1 empty))) == Just 1\n\n","type":"Queue.Queue a -> Maybe.Maybe a"},{"name":"toList","comment":"\n\n    toList empty == []\n\n    toList (fromList [ 1, 2, 3, 4, 5 ]) == [ 1, 2, 3, 4, 5 ]\n\n","type":"Queue.Queue a -> List.List a"}],"binops":[]}]