LobsterLang-0.1.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Stack

Synopsis

Documentation

top :: [a] -> Maybe a Source #

Return the top of the stack

push :: [a] -> a -> [a] Source #

Push a value onto the stack, return the new stack

pop :: [a] -> (Maybe a, [a]) Source #

Remove the top of the stack, return a tuple containing the old top and the new stack

seek :: (a -> Bool) -> [a] -> Maybe a Source #

Return the first element of the stack validating the function given as parameter

size :: [a] -> Int Source #

Return the size of the stack

clear :: [a] -> [a] Source #

Clear the stack by return an empty stack