[{"name":"Stack","comment":"\n\n@docs Stack\n\n\n# Construct\n\n@docs empty, fromList\n\n\n# Query\n\n@docs isEmpty, top\n\n\n# Modify\n\n@docs push, pop\n\n\n# Convert\n\n@docs toList\n\n","unions":[{"name":"Stack","comment":" A data structure that only allows adding and removing elements from the top,\nfollowing the **last in, first out** (**LIFO**) principle.\n","args":["a"],"cases":[]}],"aliases":[],"values":[{"name":"empty","comment":" The empty stack.\n","type":"Stack.Stack a"},{"name":"fromList","comment":" Create a stack from a list.\n","type":"List.List a -> Stack.Stack a"},{"name":"isEmpty","comment":"\n\n    isEmpty empty == True\n\n    isEmpty (fromList []) == True\n\n    isEmpty (fromList [ 1 ]) == False\n\n","type":"Stack.Stack a -> Basics.Bool"},{"name":"pop","comment":" Remove and return the last element added to the stack.\n\n    pop empty == Nothing\n\n    pop (push 1 empty) == Just ( 1, empty )\n\n    pop (push 2 (fromList [ 1 ])) == Just ( 2, fromList [ 1 ] )\n\n","type":"Stack.Stack a -> Maybe.Maybe ( a, Stack.Stack a )"},{"name":"push","comment":" Add an element to the top of the stack.\n\n    push 1 empty == fromList [ 1 ]\n\n    push 2 (fromList [ 1 ]) == fromList [ 2, 1 ]\n\n","type":"a -> Stack.Stack a -> Stack.Stack a"},{"name":"toList","comment":"\n\n    toList empty == []\n\n    toList (fromList [ 5, 4, 3, 2, 1 ]) == [ 5, 4, 3, 2, 1 ]\n\n","type":"Stack.Stack a -> List.List a"},{"name":"top","comment":" Get the last element added to the stack without modifying the stack.\n\n    top empty == Nothing\n\n    top (push 5 (fromList [ 4, 3, 2, 1 ])) == Just 5\n\n","type":"Stack.Stack a -> Maybe.Maybe a"}],"binops":[]}]