public Tuple <Que <T>, Option <T> > TryDequeue() => forward.TryPeek().Match( Some: x => Tuple(Dequeue(), Some(x)), None: () => Tuple(this, Option <T> .None) );
/// <summary> /// Safely return the item on the top of the stack without affecting the stack itself /// </summary> /// <returns>Returns the top item value, or None</returns> public static Option <T> trypeek <T>(Stck <T> stack) => stack.TryPeek();