Ejemplo n.º 1
0
 public Tuple <Que <T>, Option <T> > TryDequeue() =>
 forward.TryPeek().Match(
     Some: x => Tuple(Dequeue(), Some(x)),
     None: () => Tuple(this, Option <T> .None)
     );
Ejemplo n.º 2
0
 /// <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();