Esempio n. 1
0
        public void UseMeertensTree()
        {
            IRoseTree <Unit, int> meertensTree =
                RoseTree.Node(Unit.Instance,
                              RoseTree.Node(Unit.Instance,
                                            RoseTree.Node(Unit.Instance,
                                                          new RoseLeaf <Unit, int>(2112)),
                                            new RoseLeaf <Unit, int>(42),
                                            new RoseLeaf <Unit, int>(1337),
                                            new RoseLeaf <Unit, int>(90125)),
                              RoseTree.Node(Unit.Instance,
                                            new RoseLeaf <Unit, int>(1984)),
                              new RoseLeaf <Unit, int>(666));

            Assert.False(meertensTree.IsLeaf().ToBool());
        }
Esempio n. 2
0
 public static IChurchBoolean IsNode <N, L>(this IRoseTree <N, L> source)
 => new ChurchNot(source.IsLeaf());