1 using System.Collections.Generic;
4 using JetBrains.Annotations;
6 namespace FxSharp.Extensions
8 public static class StackExtensions
16 public static Maybe<TSource> PopOrNothing<TSource>([NotNull]
this Stack<TSource> source)
18 Ensure.NotNull(source,
"source");
20 return source.Any() ? Maybe.Just(source.Pop()) : Maybe.Nothing<TSource>();