Example #1
0
        public static bool TestPipingReassociation()
        {
            /*
             * Tests the following thing:
             * first (first f) >>> arr assoc = arr assoc >>> first f
             * The code itself is probably more expressive than any explanation I could come up
             * with.
             */

            Arrow <int, int>           f     = Op.Arr(ArrowTestUtils.GenerateFunc());
            AssocArrow <int, int, int> assoc = new AssocArrow <int, int, int>();

            Arrow <Tuple <Tuple <int, int>, int>, Tuple <int, Tuple <int, int> > > firstFirstArr =
                f.First(default(int)).First(default(int))
                .Combine(assoc);
            Arrow <Tuple <Tuple <int, int>, int>, Tuple <int, Tuple <int, int> > > arrFirst =
                assoc.Combine(f.First(default(Tuple <int, int>)));

            return(ArrowTestUtils.AssertReassociationArrowsGiveSameOutput(firstFirstArr, arrFirst));
        }
        public static bool TestPipingReassociation()
        {
            /*
             * Tests the following thing:
             * first (first f) >>> arr assoc = arr assoc >>> first f
             * The code itself is probably more expressive than any explanation I could come up
             * with.
             */

            Arrow<int, int> f = Op.Arr(ArrowTestUtils.GenerateFunc());
            AssocArrow<int, int, int> assoc = new AssocArrow<int, int, int>();

            Arrow<Tuple<Tuple<int, int>, int>, Tuple<int, Tuple<int, int>>> firstFirstArr =
                f.First(default(int)).First(default(int))
                .Combine(assoc);
            Arrow<Tuple<Tuple<int, int>, int>, Tuple<int, Tuple<int, int>>> arrFirst =
                assoc.Combine(f.First(default(Tuple<int, int>)));

            return ArrowTestUtils.AssertReassociationArrowsGiveSameOutput(firstFirstArr, arrFirst);
        }