Example #1
0
 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());
 }
Example #2
0
 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());
 }
Example #3
0
 static Maybe <Maybe <T> > __ <T>(T x) where T : struct => Maybe.Some(Maybe.SomeOrNone((T?)x));
Example #4
0
            public static void Flatten_SomeOfSome_ForReferenceT()
            {
                Maybe <AnyT> some = AnyT.Some;

                Assert.Equal(some, Maybe.Some(some).Flatten());
            }
Example #5
0
 static Maybe <Maybe <T> > __ <T>(T x) where T : struct => Maybe.Some(Maybe.Some(x));