Пример #1
0
        public void ContSelectMany01Test()
        {
            MonadPrimus.Cont <int, int> m01 = x => x(765);
            var m11 = m01.SelectMany <int, int, int>(x => y => y(x + 100));

            Assert.AreEqual(876, m11(x => x + 11));
        }
Пример #2
0
        public void ContMonadRule2Test()
        {
            MonadPrimus.Cont <int, int> m00 = x => x(765);
            var m11   = m00.SelectMany(MonadPrimus.ToCont <int, int>);
            var m12   = m00;
            var res11 = m11(x => x + 111);
            var res12 = m12(x => x + 111);

            Assert.AreEqual(876, res11);
            Assert.AreEqual(876, res12);
        }