From 7e0415279e78d573ed6e83065274af5ab03b7f0f Mon Sep 17 00:00:00 2001 From: widmogrod Date: Tue, 19 Dec 2017 18:54:58 +0100 Subject: [PATCH] Clean up old Free implementation --- README.md | 1 - composer.json | 2 +- test/Monad/FreeTest.php | 105 ------------------------------------------------ 3 files changed, 1 insertion(+), 107 deletions(-) delete mode 100644 test/Monad/FreeTest.php diff --git a/README.md b/README.md index cf92a70..77b3388 100644 --- a/README.md +++ b/README.md @@ -244,7 +244,6 @@ Free monad enables you to do exactly that, and more: #### Echo program Example Free Monad example of `echo program` can be found here: -- See source code [FreeMonadTest.php](/example/FreeMonadTest.php) - example based on first implementation of Free - See source code [Free2MonadTest.php](/example/Free2MonadTest.php) - example based on second implementation of Free, based on [Haskell implementation](https://hackage.haskell.org/package/free-4.12.4/docs/Control-Monad-Free-Class.html) #### DSL for `BDD` tests diff --git a/composer.json b/composer.json index fb8e0d5..8bfd133 100644 --- a/composer.json +++ b/composer.json @@ -32,6 +32,7 @@ "files": [ "src/Functional/functions.php", "src/Functional/miscellaneous.php", + "src/Functional/listt.php", "src/Functional/predicates.php", "src/Functional/strings.php", "src/Functional/monoid.php", @@ -39,7 +40,6 @@ "src/Monad/Control/functions.php", "src/Monad/Either/functions.php", "src/Monad/Maybe/functions.php", - "src/Monad/Free/functions.php", "src/Monad/Free2/functions.php", "src/Monad/IO/functions.php", "src/Monad/IO/errors.php", diff --git a/test/Monad/FreeTest.php b/test/Monad/FreeTest.php deleted file mode 100644 index 46a74a3..0000000 --- a/test/Monad/FreeTest.php +++ /dev/null @@ -1,105 +0,0 @@ -assertEquals( - $a->runFree(identity), - $b->runFree(identity), - $message - ); - }, - $f, - $g, - $x - ); - } - - public function provideFunctorTestData() - { - return [ - 'Pure' => [ - '$f' => function ($x) { - return $x + 1; - }, - '$g' => function ($x) { - return $x + 5; - }, - '$x' => Pure::of(1), - ], - 'Free' => [ - '$f' => function ($x) { - return $x + 1; - }, - '$g' => function ($x) { - return $x + 5; - }, - '$x' => liftF(Identity::of(1)), - ], - ]; - } - - /** - * @dataProvider provideMonadTestData - */ - public function test_it_should_obey_monad_laws($f, $g, $x) - { - MonadLaws::test( - function (MonadFree $f, MonadFree $g, $message) { - $this->assertEquals( - $f->runFree(identity), - $g->runFree(identity), - $message - ); - }, - function ($x) { - return Pure::of($x); - }, - $f, - $g, - $x - ); - } - - public function provideMonadTestData() - { - $addOne = function ($x) { - return liftF(Identity::of( - $x + 1 - )); - }; - $addTwo = function ($x) { - return liftF(Identity::of( - $x + 2 - )); - }; - - return [ - 'Identity' => [ - '$f' => $addOne, - '$g' => $addTwo, - '$x' => 10, - ], - ]; - } -} -- 2.11.0