OptionExtensionsFlattenT Method
Flattens the option of option of
T.
Maps Opt<Opt<T>> to Opt<T> as follows:
- None => None<T>(),
- Some(None<T>()) => None<T>(),
- Some(Some(T)) => Some(T).
Assert(None<Opt<char>>().Flatten() == None<char>());
Assert(Some(None<char>()).Flatten() == None<char>());
Assert(Some(Some('c')).Flatten() == Some('c'));
Namespace: Orx.Fun.OptionAssembly: Orx.Fun.Option (in Orx.Fun.Option.dll) Version: 1.2.1+ea79806fa5e0e04bfdaef2a1916930e75e2cde74
public static Opt<T> Flatten<T>(
this Opt<Opt<T>> option
)
- option OptOptT
- Nested option to flatten.
- T
[Missing <typeparam name="T"/> documentation for "M:Orx.Fun.Option.OptionExtensions.Flatten``1(Orx.Fun.Option.Opt{Orx.Fun.Option.Opt{``0}})"]
OptTIn Visual Basic and C#, you can call this method as an instance method on any object of type
OptOptT. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).