public static void Flatten_SomeOfNone_ForValueT_AndNullable() { Assert.Equal(Maybe <Unit?> .None, Maybe.Some(Maybe <Unit?> .None).Flatten()); Assert.Equal(Maybe <int?> .None, Maybe.Some(Maybe <int?> .None).Flatten()); Assert.Equal(Maybe <long?> .None, Maybe.Some(Maybe <long?> .None).Flatten()); }
public static void Flatten_SomeOfNone_ForValueT() { Assert.Equal(Maybe <Unit> .None, Maybe.Some(Maybe <Unit> .None).Flatten()); Assert.Equal(Maybe <int> .None, Maybe.Some(Maybe <int> .None).Flatten()); Assert.Equal(Maybe <long> .None, Maybe.Some(Maybe <long> .None).Flatten()); }
static Maybe <Maybe <T> > __ <T>(T x) where T : struct => Maybe.Some(Maybe.SomeOrNone((T?)x));
public static void Flatten_SomeOfSome_ForReferenceT() { Maybe <AnyT> some = AnyT.Some; Assert.Equal(some, Maybe.Some(some).Flatten()); }
static Maybe <Maybe <T> > __ <T>(T x) where T : struct => Maybe.Some(Maybe.Some(x));