Exemple #1
0
        public static void IntMonoidTest()
        {
            var intMult = new Monoid <int>(1, (x, y) => x * y);

            Assert.Equal(5, intMult.Op(intMult.Neutral, 5));
            Assert.Equal(5, intMult.Op(5, intMult.Neutral));
            Assert.Equal(15, intMult.Op(3, 5));
        }