Header menu logo TDesu.FSharp

Stack Module

Functions and values

Function or value Description

pop stack

Full Usage: pop stack

Parameters:
Returns: 'T
Modifiers: inline
Type parameters: 'T

Removes and returns the top element from the stack. A null is treated as an empty stack, so it raises the same a real empty stack would, not a null-reference error. When the stack is empty, including when is null. The stack to pop from.

stack : Stack<'T>
Returns: 'T

push item stack

Full Usage: push item stack

Parameters:
    item : 'T
    stack : Stack<'T>

Modifiers: inline
Type parameters: 'T

Pushes an item onto the top of the stack. is the mutation target: unlike the read-only helpers in this module, a null has no empty instance to push onto, so it is a programmer error. When is null. The item to push. The stack to push onto.

item : 'T
stack : Stack<'T>

reverse stack

Full Usage: reverse stack

Parameters:
Returns: Stack<'T>

Returns a new stack with elements in reverse order. A null is treated as empty and yields a new empty stack. The stack to reverse.

stack : Stack<'T>
Returns: Stack<'T>

tryPeek stack

Full Usage: tryPeek stack

Parameters:
Returns: 'T option
Modifiers: inline
Type parameters: 'T

Returns the top element as Some, or None if the stack is empty or null. The stack to peek into.

stack : Stack<'T>
Returns: 'T option

Type something to start searching.