示例#1
0
    def test_applicative_2nd_low(self):
        seq = Seq(1, 2, 3, 4, 5)

        def identity(x):
            return x

        self.assertEqual(seq.ap(Seq(identity)), seq)
示例#2
0
    def test_applicative_1st_low(self):
        seq = Seq(1, 2, 3, 4, 5)

        def f(x):
            return x + 1

        self.assertEqual(seq.ap(Seq(f)), seq.map(f))