Пример #1
0
        public void TestOptionT2()
        {
            var list = List(Some(1), Some(2), Some(3), Some(4), Some(5));

            var newlist = OptionT.Bind <MLst <Option <int> >, Lst <Option <int> >, MOption <int>, Option <int>, int>(
                list,
                x => x % 2 == 0 ? Some(x) : None
                );

            Assert.True(newlist == List(None, Some(2), None, Some(4), None));
        }