Stack
Edit on GitHubAn immutable stack implementation. A stack is a LIFO (last-in-first-out) data structure where new values are added, retrieved, and removed from the end.
Values
Stack.make
Creates a new stack.
Stack.isEmpty
Checks if the given stack contains no items.
Stack.head
Deprecated: Please use
Stack.peek
instead.Stack.head
will be removed in v0.4.0.
Returns Some(item)
where item
is the value at the top of the stack, and None
otherwise.
Stack.push
Adds a new item to the top of the stack.
Stack.pop
Removes the item at the top of the stack.
Stack.size
Computes the size of the input stack.