Esempio n. 1
0
        public void SecondFunctorLawHoldsForMapNode(IRoseTree <int, string> t)
        {
            char f(bool b) => b ? 'T' : 'F';
            bool g(int i) => i % 2 == 0;

            Assert.Equal(
                t.MapNode(x => f(g(x))),
                t.MapNode(g).MapNode(f));
        }
Esempio n. 2
0
        public void ConsistencyLawHolds(IRoseTree <int, string> t)
        {
            DateTime f(int i) => new DateTime(i);
            bool g(string s) => string.IsNullOrWhiteSpace(s);

            Assert.Equal(t.BiMap(f, g), t.MapLeaf(g).MapNode(f));
            Assert.Equal(
                t.MapNode(f).MapLeaf(g),
                t.MapLeaf(g).MapNode(f));
        }
Esempio n. 3
0
 public void MapNodeObeysFirstFunctoryLaw(IRoseTree <int, string> t)
 {
     Assert.Equal(t, t.MapNode(Id));
 }