Use FunctionalPHP\FantasyLand
authorwidmogrod <widmogrod@gmail.com>
Sun, 18 Feb 2018 18:03:26 +0000 (19:03 +0100)
committerwidmogrod <widmogrod@gmail.com>
Sun, 18 Feb 2018 18:03:26 +0000 (19:03 +0100)
70 files changed:
composer.json
composer.lock
example/FreeBddStyleDSLTest.php
example/FreeCalculatorTest.php
example/FreeMonadTest.php
src/FantasyLand/Applicative.php [deleted file]
src/FantasyLand/Apply.php [deleted file]
src/FantasyLand/Chain.php [deleted file]
src/FantasyLand/Comonad.php [deleted file]
src/FantasyLand/Extend.php [deleted file]
src/FantasyLand/Foldable.php [deleted file]
src/FantasyLand/Functor.php [deleted file]
src/FantasyLand/Monad.php [deleted file]
src/FantasyLand/Monoid.php [deleted file]
src/FantasyLand/Pointed.php [deleted file]
src/FantasyLand/Semigroup.php [deleted file]
src/FantasyLand/Setoid.php [deleted file]
src/FantasyLand/Traversable.php [deleted file]
src/Functional/functions.php
src/Functional/listt.php
src/Functional/monoid.php
src/Functional/setoid.php
src/Helpful/ApplicativeLaws.php [deleted file]
src/Helpful/FunctorLaws.php [deleted file]
src/Helpful/MonadLaws.php [deleted file]
src/Helpful/MonoidLaws.php [deleted file]
src/Helpful/SetoidLaws.php [deleted file]
src/Monad/Control/Doo/Algebra/DooF.php
src/Monad/Control/Doo/Algebra/In.php
src/Monad/Control/Doo/Algebra/Let.php
src/Monad/Control/Doo/actions.php
src/Monad/Control/Doo/interpretation.php
src/Monad/Either/Either.php
src/Monad/Either/Left.php
src/Monad/Either/Right.php
src/Monad/Free/Free.php
src/Monad/Free/MonadFree.php
src/Monad/Free/Pure.php
src/Monad/Free/functions.php
src/Monad/IO.php
src/Monad/Identity.php
src/Monad/Maybe/Just.php
src/Monad/Maybe/Maybe.php
src/Monad/Maybe/Nothing.php
src/Monad/Reader.php
src/Monad/State.php
src/Monad/Writer.php
src/Monad/Writer/functions.php
src/Primitive/Listt.php
src/Primitive/ListtCons.php
src/Primitive/ListtNil.php
src/Primitive/Num.php
src/Primitive/Product.php
src/Primitive/Stringg.php
src/Primitive/Sum.php
test/Functional/JoinTest.php
test/Functional/LengthTest.php
test/Monad/EitherTest.php
test/Monad/FreeTest.php
test/Monad/IOTest.php
test/Monad/IdentityTest.php
test/Monad/MaybeTest.php
test/Monad/ReaderTest.php
test/Monad/StateTest.php
test/Monad/WriterTest.php
test/Primitive/ListtTest.php
test/Primitive/NumTest.php
test/Primitive/ProductTest.php
test/Primitive/StringgTest.php
test/Primitive/SumTest.php

index a3a550b..10fbbfa 100644 (file)
@@ -2,7 +2,8 @@
   "name": "widmogrod/php-functional",
   "description": "Functors, Applicative and Monads are fascinating concept. Purpose of this library is to explore them in OOP PHP world.",
   "require": {
-    "php": ">=7.1"
+    "php": ">=7.1",
+    "functional-php/fantasy-land": "^1"
   },
   "require-dev": {
     "phpunit/phpunit": "^6",
index bea85d8..6cf2cd7 100644 (file)
@@ -4,8 +4,53 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
         "This file is @generated automatically"
     ],
-    "content-hash": "d3bba8e335a995bd53543036052e37ba",
-    "packages": [],
+    "content-hash": "722371fce21dbeed7ea53b65ff26950a",
+    "packages": [
+        {
+            "name": "functional-php/fantasy-land",
+            "version": "1.0.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/functional-php/fantasy-land.git",
+                "reference": "c855c856e70db81032a8a4fd17bd74a58d26a279"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/functional-php/fantasy-land/zipball/c855c856e70db81032a8a4fd17bd74a58d26a279",
+                "reference": "c855c856e70db81032a8a4fd17bd74a58d26a279",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.1"
+            },
+            "require-dev": {
+                "friendsofphp/php-cs-fixer": "^2",
+                "giorgiosironi/eris": "^0.9",
+                "phpunit/phpunit": "^5"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "FunctionalPHP\\": "./src"
+                },
+                "files": [
+                    "src/FantasyLand/functions.php"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Gabriel Habryn",
+                    "email": "widmogrod+github@gmail.com"
+                }
+            ],
+            "description": "Specification for interoperability of common algebraic structures in PHP",
+            "time": "2018-02-18T14:54:04+00:00"
+        }
+    ],
     "packages-dev": [
         {
             "name": "composer/semver",
index 61a3956..37e29ba 100644 (file)
@@ -4,7 +4,7 @@ declare(strict_types=1);
 
 namespace example;
 
-use Widmogrod\FantasyLand\Functor;
+use FunctionalPHP\FantasyLand\Functor;
 use Widmogrod\Monad\Free\MonadFree;
 use Widmogrod\Monad\Free\Pure;
 use Widmogrod\Monad\State;
index ce496fd..ab6329b 100644 (file)
@@ -4,7 +4,7 @@ declare(strict_types=1);
 
 namespace example;
 
-use Widmogrod\FantasyLand\Functor;
+use FunctionalPHP\FantasyLand\Functor;
 use Widmogrod\Monad\Free\MonadFree;
 use Widmogrod\Monad\Free\Pure;
 use Widmogrod\Monad\Identity;
index 89d15cc..e3cd3c0 100644 (file)
@@ -4,7 +4,7 @@ declare(strict_types=1);
 
 namespace example2;
 
-use Widmogrod\FantasyLand\Functor;
+use FunctionalPHP\FantasyLand\Functor;
 use Widmogrod\Functional as f;
 use Widmogrod\Monad\Free as ff;
 use Widmogrod\Monad\Free\MonadFree;
diff --git a/src/FantasyLand/Applicative.php b/src/FantasyLand/Applicative.php
deleted file mode 100644 (file)
index cef478b..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace Widmogrod\FantasyLand;
-
-interface Applicative extends
-    Apply,
-    Pointed
-{
-}
diff --git a/src/FantasyLand/Apply.php b/src/FantasyLand/Apply.php
deleted file mode 100644 (file)
index a94c4df..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace Widmogrod\FantasyLand;
-
-interface Apply extends Functor
-{
-    /**
-     * @param Apply $b
-     *
-     * @return self
-     */
-    public function ap(self $b): self;
-}
diff --git a/src/FantasyLand/Chain.php b/src/FantasyLand/Chain.php
deleted file mode 100644 (file)
index 94b0afe..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace Widmogrod\FantasyLand;
-
-interface Chain extends Apply
-{
-    /**
-     * bind :: Monad m => (a -> m b) -> m b
-     *
-     * @return mixed|\Closure
-     *
-     * @param callable $function
-     *
-     * @return self
-     */
-    public function bind(callable $function);
-}
diff --git a/src/FantasyLand/Comonad.php b/src/FantasyLand/Comonad.php
deleted file mode 100644 (file)
index 4300b49..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace Widmogrod\FantasyLand;
-
-interface Comonad extends
-    Functor,
-    Extend
-{
-    public function extract();
-}
diff --git a/src/FantasyLand/Extend.php b/src/FantasyLand/Extend.php
deleted file mode 100644 (file)
index 70c3dea..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace Widmogrod\FantasyLand;
-
-interface Extend
-{
-    /**
-     * @param callable $function
-     *
-     * @return self
-     */
-    public function extend(callable $function);
-}
diff --git a/src/FantasyLand/Foldable.php b/src/FantasyLand/Foldable.php
deleted file mode 100644 (file)
index ce6ede0..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace Widmogrod\FantasyLand;
-
-interface Foldable
-{
-    /**
-     * reduce :: (b -> a -> b) -> b -> b
-     *
-     * @param callable $function    Binary function ($accumulator, $value)
-     * @param mixed    $accumulator Value to witch reduce
-     *
-     * @return mixed Same type as $accumulator
-     */
-    public function reduce(callable $function, $accumulator);
-}
diff --git a/src/FantasyLand/Functor.php b/src/FantasyLand/Functor.php
deleted file mode 100644 (file)
index d38b17e..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace Widmogrod\FantasyLand;
-
-interface Functor
-{
-    /**
-     * map :: Functor f => (a -> b) -> f b
-     *
-     * @param callable $function
-     *
-     * @return self
-     */
-    public function map(callable $function): self;
-}
diff --git a/src/FantasyLand/Monad.php b/src/FantasyLand/Monad.php
deleted file mode 100644 (file)
index 1ffc2be..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace Widmogrod\FantasyLand;
-
-interface Monad extends
-    Applicative,
-    Chain
-{
-}
diff --git a/src/FantasyLand/Monoid.php b/src/FantasyLand/Monoid.php
deleted file mode 100644 (file)
index 770cbcd..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace Widmogrod\FantasyLand;
-
-interface Monoid extends Semigroup
-{
-    /**
-     * @return Monoid
-     */
-    public static function mempty();
-}
diff --git a/src/FantasyLand/Pointed.php b/src/FantasyLand/Pointed.php
deleted file mode 100644 (file)
index ec20bf7..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace Widmogrod\FantasyLand;
-
-interface Pointed
-{
-    /**
-     * Put $value in default minimal context.
-     *
-     * @param mixed $value
-     *
-     * @return mixed
-     */
-    public static function of($value);
-}
diff --git a/src/FantasyLand/Semigroup.php b/src/FantasyLand/Semigroup.php
deleted file mode 100644 (file)
index 1d68ea6..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace Widmogrod\FantasyLand;
-
-interface Semigroup
-{
-    /**
-     * Return result of applying one semigroup with another.
-     *
-     * @param Semigroup $value
-     *
-     * @return self
-     */
-    public function concat(self $value): self;
-}
diff --git a/src/FantasyLand/Setoid.php b/src/FantasyLand/Setoid.php
deleted file mode 100644 (file)
index 1e895ca..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace Widmogrod\FantasyLand;
-
-interface Setoid
-{
-    /**
-     * @param Setoid|mixed $other
-     *
-     * @return bool
-     */
-    public function equals($other): bool;
-}
diff --git a/src/FantasyLand/Traversable.php b/src/FantasyLand/Traversable.php
deleted file mode 100644 (file)
index 7d80d60..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace Widmogrod\FantasyLand;
-
-interface Traversable extends Functor
-{
-    /**
-     * traverse :: Applicative f => (a -> f b) -> f (t b)
-     *
-     * Where the `a` is value inside of container.
-     *
-     * @param callable $fn (a -> f b)
-     *
-     * @return Applicative f (t b)
-     */
-    public function traverse(callable $fn);
-}
index cbab20a..70f7f2f 100644 (file)
@@ -5,11 +5,11 @@ declare(strict_types=1);
 namespace Widmogrod\Functional;
 
 use Widmogrod\Common\ValueOfInterface;
-use Widmogrod\FantasyLand\Applicative;
-use Widmogrod\FantasyLand\Foldable;
-use Widmogrod\FantasyLand\Functor;
-use Widmogrod\FantasyLand\Monad;
-use Widmogrod\FantasyLand\Traversable;
+use FunctionalPHP\FantasyLand\Applicative;
+use FunctionalPHP\FantasyLand\Foldable;
+use FunctionalPHP\FantasyLand\Functor;
+use FunctionalPHP\FantasyLand\Monad;
+use FunctionalPHP\FantasyLand\Traversable;
 use Widmogrod\Primitive\Listt;
 use Widmogrod\Primitive\ListtCons;
 
index eb4e549..22639b2 100644 (file)
@@ -4,7 +4,7 @@ declare(strict_types=1);
 
 namespace Widmogrod\Functional;
 
-use Widmogrod\FantasyLand\Foldable;
+use FunctionalPHP\FantasyLand\Foldable;
 use Widmogrod\Primitive\Listt;
 use Widmogrod\Primitive\ListtCons;
 use Widmogrod\Useful\SnapshotIterator;
index ebc0111..77805c2 100644 (file)
@@ -4,8 +4,8 @@ declare(strict_types=1);
 
 namespace Widmogrod\Functional;
 
-use Widmogrod\FantasyLand\Monoid;
-use Widmogrod\FantasyLand\Semigroup;
+use FunctionalPHP\FantasyLand\Monoid;
+use FunctionalPHP\FantasyLand\Semigroup;
 
 const emptyM = 'Widmogrod\Functional\emptyM';
 
index c4a55ab..ab863b8 100644 (file)
@@ -4,7 +4,7 @@ declare(strict_types=1);
 
 namespace Widmogrod\Functional;
 
-use Widmogrod\FantasyLand\Setoid;
+use FunctionalPHP\FantasyLand\Setoid;
 
 const equal = 'Widmogrod\Functional\equal';
 
diff --git a/src/Helpful/ApplicativeLaws.php b/src/Helpful/ApplicativeLaws.php
deleted file mode 100644 (file)
index 319912b..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace Widmogrod\Helpful;
-
-use Widmogrod\FantasyLand\Applicative;
-use Widmogrod\Functional as f;
-
-class ApplicativeLaws
-{
-    /**
-     * Generic test to verify if a type obey the applicative laws.
-     *
-     * @param callable    $assertEqual Asserting function (Applicative $a1, Applicative $a2, $message)
-     * @param callable    $pure        Applicative "constructor"
-     * @param Applicative $u           Applicative f => f (a -> b)
-     * @param Applicative $v           Applicative f => f (a -> b)
-     * @param Applicative $w           Applicative f => f (a -> b)
-     * @param callable    $f           (a -> b)
-     * @param mixed       $x           Value to put into a applicative
-     */
-    public static function test(
-        callable $assertEqual,
-        callable $pure,
-        Applicative $u,
-        Applicative $v,
-        Applicative $w,
-        callable $f,
-        $x
-    ) {
-        // identity: pure id <*> v = v
-        $assertEqual(
-            $pure(f\identity)->ap($v),
-            $v,
-            'identity'
-        );
-
-        // homomorphism: pure f <*> pure x = pure (f x)
-        $assertEqual(
-            $pure($f)->ap($pure($x)),
-            $pure($f($x)),
-            'homomorphism'
-        );
-
-        // interchange: u <*> pure x = pure ($ x) <*> u
-        $assertEqual(
-            $u->ap($pure($x)),
-            $pure(f\applicator($x))->ap($u),
-            'interchange'
-        );
-
-        // composition: pure (.) <*> u <*> v <*> w = u <*> (v <*> w)
-        $compose = f\curryN(2, f\compose);
-        $assertEqual(
-            $pure($compose)->ap($u)->ap($v)->ap($w),
-            $u->ap($v->ap($w)),
-            'composition'
-        );
-    }
-}
diff --git a/src/Helpful/FunctorLaws.php b/src/Helpful/FunctorLaws.php
deleted file mode 100644 (file)
index 4acac01..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace Widmogrod\Helpful;
-
-use Widmogrod\FantasyLand\Functor;
-use Widmogrod\Functional as f;
-
-class FunctorLaws
-{
-    /**
-     * Generic test to verify if a type obey the functor laws.
-     *
-     * @param callable $assertEqual Asserting function (Functor $f1, Functor $f2, $message)
-     * @param callable $f           (a -> b)
-     * @param callable $g           (a -> b)
-     * @param Functor  $x           f a
-     */
-    public static function test(
-        callable $assertEqual,
-        callable $f,
-        callable $g,
-        Functor $x
-    ) {
-        // identity: fmap id  ==  id
-        $assertEqual(
-            f\map(f\identity, $x),
-            $x,
-            'identity'
-        );
-
-        // composition: fmap (f . g)  ==  fmap f . fmap g
-        $assertEqual(
-            f\map(f\compose($f, $g), $x),
-            f\compose(f\map($f), f\map($g))($x),
-            'composition'
-        );
-    }
-}
diff --git a/src/Helpful/MonadLaws.php b/src/Helpful/MonadLaws.php
deleted file mode 100644 (file)
index 05d6f07..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace Widmogrod\Helpful;
-
-use Widmogrod\Functional as f;
-
-class MonadLaws
-{
-    /**
-     * Generic test to verify if a type obey the monad laws.
-     *
-     * @param callable $assertEqual Asserting function (Monad $m1, Monad $m2, $message)
-     * @param callable $return      Monad "constructor"
-     * @param callable $f           Monadic function
-     * @param callable $g           Monadic function
-     * @param mixed    $x           Value to put into a monad
-     */
-    public static function test(
-        callable $assertEqual,
-        callable $return,
-        callable $f,
-        callable $g,
-        $x
-    ) {
-        // Make reading bellow tests easier
-        $m = $return($x);
-
-        // left identity: (return x) >>= f â‰¡ f x
-        $assertEqual(f\bind($f, $return($x)), $f($x), 'left identity');
-
-        // right identity: m >>= return â‰¡ m
-        $assertEqual(f\bind($return, $m), $m, 'right identity');
-
-        // associativity: (m >>= f) >>= g â‰¡ m >>= ( \x -> (f x >>= g) )
-        $assertEqual(
-            f\bind($g, f\bind($f, $m)),
-            f\bind(function ($x) use ($f, $g) {
-                return f\bind($g, $f($x));
-            }, $m),
-            'associativity'
-        );
-    }
-}
diff --git a/src/Helpful/MonoidLaws.php b/src/Helpful/MonoidLaws.php
deleted file mode 100644 (file)
index bb9aef0..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace Widmogrod\Helpful;
-
-use Widmogrod\FantasyLand\Monoid;
-use Widmogrod\Functional as f;
-
-class MonoidLaws
-{
-    /**
-     * Generic test to verify if a type obey the monodic laws.
-     *
-     * @param callable $assertEqual Asserting function (Monoid $m1, Monoid $m2, $message)
-     * @param Monoid   $x
-     * @param Monoid   $y
-     * @param Monoid   $z
-     */
-    public static function test(
-        callable $assertEqual,
-        Monoid $x,
-        Monoid $y,
-        Monoid $z
-    ) {
-        $assertEqual(
-            f\concatM($x, f\emptyM($x)),
-            $x,
-            'Right identity'
-        );
-        $assertEqual(
-            f\concatM(f\emptyM($x), $x),
-            $x,
-            'Left identity'
-        );
-
-        $assertEqual(
-            f\concatM($x, f\concatM($y, $z)),
-            f\concatM(f\concatM($x, $y), $z),
-            'Associativity'
-        );
-    }
-}
diff --git a/src/Helpful/SetoidLaws.php b/src/Helpful/SetoidLaws.php
deleted file mode 100644 (file)
index cc3e673..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace Widmogrod\Helpful;
-
-use Widmogrod\FantasyLand\Setoid;
-use Widmogrod\Functional as f;
-
-class SetoidLaws
-{
-    /**
-     * @param callable $assertEqual
-     * @param Setoid   $a
-     * @param Setoid   $b
-     * @param Setoid   $c
-     */
-    public static function test(
-        callable $assertEqual,
-        Setoid $a,
-        Setoid $b,
-        Setoid $c
-    ) {
-        $assertEqual(
-            f\equal($a, $a),
-            true,
-            'reflexivity'
-        );
-
-        $assertEqual(
-            f\equal($a, $b),
-            f\equal($b, $a),
-            'symmetry'
-        );
-
-        $assertEqual(
-            f\equal($a, $b) && f\equal($b, $c),
-            f\equal($a, $c),
-            'transitivity'
-        );
-    }
-}
index cc054b3..a4739d3 100644 (file)
@@ -3,7 +3,7 @@
 declare(strict_types=1);
 namespace Widmogrod\Monad\Control\Doo\Algebra;
 
-use Widmogrod\FantasyLand\Functor;
+use FunctionalPHP\FantasyLand\Functor;
 use Widmogrod\Useful\PatternMatcher;
 
 /**
index ad9de04..cf89a87 100644 (file)
@@ -4,7 +4,7 @@ declare(strict_types=1);
 
 namespace Widmogrod\Monad\Control\Doo\Algebra;
 
-use Widmogrod\FantasyLand\Functor;
+use FunctionalPHP\FantasyLand\Functor;
 use function Widmogrod\Functional\compose;
 
 class In implements DooF
index 89640a3..e6bd309 100644 (file)
@@ -3,8 +3,8 @@
 declare(strict_types=1);
 namespace Widmogrod\Monad\Control\Doo\Algebra;
 
-use Widmogrod\FantasyLand\Functor;
-use Widmogrod\FantasyLand\Monad;
+use FunctionalPHP\FantasyLand\Functor;
+use FunctionalPHP\FantasyLand\Monad;
 use Widmogrod\Monad\Free\MonadFree;
 
 class Let implements DooF
index 6324877..4f7fc85 100644 (file)
@@ -4,7 +4,7 @@ declare(strict_types=1);
 
 namespace Widmogrod\Monad\Control\Doo;
 
-use Widmogrod\FantasyLand\Monad;
+use FunctionalPHP\FantasyLand\Monad;
 use Widmogrod\Monad\Free\MonadFree;
 use Widmogrod\Monad\Free\Pure;
 use function Widmogrod\Monad\Free\liftF;
index 05c09a6..43bd779 100644 (file)
@@ -3,7 +3,7 @@
 declare(strict_types=1);
 namespace Widmogrod\Monad\Control\Doo;
 
-use Widmogrod\FantasyLand\Monad;
+use FunctionalPHP\FantasyLand\Monad;
 use Widmogrod\Monad\Control\Doo\Algebra\DooF;
 use Widmogrod\Monad\Control\Doo\Algebra\In;
 use Widmogrod\Monad\Control\Doo\Algebra\Let;
index e03c60d..457d13b 100644 (file)
@@ -5,7 +5,7 @@ declare(strict_types=1);
 namespace Widmogrod\Monad\Either;
 
 use Widmogrod\Common;
-use Widmogrod\FantasyLand;
+use FunctionalPHP\FantasyLand;
 
 interface Either extends
     FantasyLand\Monad,
index 363e604..b837f0c 100644 (file)
@@ -5,7 +5,7 @@ declare(strict_types=1);
 namespace Widmogrod\Monad\Either;
 
 use Widmogrod\Common;
-use Widmogrod\FantasyLand;
+use FunctionalPHP\FantasyLand;
 
 class Left implements Either
 {
index f6deb46..bcd01be 100644 (file)
@@ -5,7 +5,7 @@ declare(strict_types=1);
 namespace Widmogrod\Monad\Either;
 
 use Widmogrod\Common;
-use Widmogrod\FantasyLand;
+use FunctionalPHP\FantasyLand;
 
 class Right implements Either
 {
index f69184d..415b504 100644 (file)
@@ -4,7 +4,7 @@ declare(strict_types=1);
 
 namespace Widmogrod\Monad\Free;
 
-use Widmogrod\FantasyLand;
+use FunctionalPHP\FantasyLand;
 use function Widmogrod\Functional\bind;
 
 /**
index 5fe2571..6f789b9 100644 (file)
@@ -4,7 +4,7 @@ declare(strict_types=1);
 
 namespace Widmogrod\Monad\Free;
 
-use Widmogrod\FantasyLand;
+use FunctionalPHP\FantasyLand;
 
 interface MonadFree extends FantasyLand\Monad
 {
index 7ebfd28..a3ae118 100644 (file)
@@ -5,7 +5,7 @@ declare(strict_types=1);
 namespace Widmogrod\Monad\Free;
 
 use Widmogrod\Common;
-use Widmogrod\FantasyLand;
+use FunctionalPHP\FantasyLand;
 
 class Pure implements MonadFree
 {
index d7788e7..3223793 100644 (file)
@@ -4,8 +4,8 @@ declare(strict_types=1);
 
 namespace Widmogrod\Monad\Free;
 
-use Widmogrod\FantasyLand\Functor;
-use Widmogrod\FantasyLand\Monad;
+use FunctionalPHP\FantasyLand\Functor;
+use FunctionalPHP\FantasyLand\Monad;
 use function Widmogrod\Functional\curryN;
 
 /**
index 43ca21f..ea38426 100644 (file)
@@ -5,7 +5,7 @@ declare(strict_types=1);
 namespace Widmogrod\Monad;
 
 use Widmogrod\Common;
-use Widmogrod\FantasyLand;
+use FunctionalPHP\FantasyLand;
 
 class IO implements
     FantasyLand\Monad,
index 35cc325..346169c 100644 (file)
@@ -5,7 +5,7 @@ declare(strict_types=1);
 namespace Widmogrod\Monad;
 
 use Widmogrod\Common;
-use Widmogrod\FantasyLand;
+use FunctionalPHP\FantasyLand;
 
 class Identity implements
     FantasyLand\Monad,
index 1629c74..3cfb4ab 100644 (file)
@@ -5,7 +5,7 @@ declare(strict_types=1);
 namespace Widmogrod\Monad\Maybe;
 
 use Widmogrod\Common;
-use Widmogrod\FantasyLand;
+use FunctionalPHP\FantasyLand;
 use Widmogrod\Primitive\TypeMismatchError;
 
 class Just implements Maybe
index 0f8425d..281c6f7 100644 (file)
@@ -5,7 +5,7 @@ declare(strict_types=1);
 namespace Widmogrod\Monad\Maybe;
 
 use Widmogrod\Common;
-use Widmogrod\FantasyLand;
+use FunctionalPHP\FantasyLand;
 
 interface Maybe extends
     FantasyLand\Monad,
index 91df3dd..538990e 100644 (file)
@@ -4,7 +4,7 @@ declare(strict_types=1);
 
 namespace Widmogrod\Monad\Maybe;
 
-use Widmogrod\FantasyLand;
+use FunctionalPHP\FantasyLand;
 
 class Nothing implements Maybe
 {
index a423ed1..209dda2 100644 (file)
@@ -5,7 +5,7 @@ declare(strict_types=1);
 namespace Widmogrod\Monad;
 
 use Widmogrod\Common;
-use Widmogrod\FantasyLand;
+use FunctionalPHP\FantasyLand;
 
 class Reader implements FantasyLand\Monad
 {
index 1796176..8fb04be 100644 (file)
@@ -5,7 +5,7 @@ declare(strict_types=1);
 namespace Widmogrod\Monad;
 
 use Widmogrod\Common;
-use Widmogrod\FantasyLand;
+use FunctionalPHP\FantasyLand;
 
 class State implements FantasyLand\Monad
 {
index 2a3b399..4df6236 100644 (file)
@@ -4,7 +4,7 @@ declare(strict_types=1);
 
 namespace Widmogrod\Monad;
 
-use Widmogrod\FantasyLand;
+use FunctionalPHP\FantasyLand;
 use Widmogrod\Primitive\Stringg as S;
 
 class Writer implements FantasyLand\Monad
index 0e9d99b..29236b9 100644 (file)
@@ -4,7 +4,7 @@ declare(strict_types=1);
 
 namespace Widmogrod\Monad\Writer;
 
-use Widmogrod\FantasyLand;
+use FunctionalPHP\FantasyLand;
 use Widmogrod\Monad as M;
 
 const pure = 'Widmogrod\Monad\Writer\pure';
index 30889cd..e343ca2 100644 (file)
@@ -5,7 +5,7 @@ declare(strict_types=1);
 namespace Widmogrod\Primitive;
 
 use Widmogrod\Common;
-use Widmogrod\FantasyLand;
+use FunctionalPHP\FantasyLand;
 
 /**
  * data List a = Nil | Cons a (List a)
index ed0df28..c5e43bb 100644 (file)
@@ -5,7 +5,7 @@ declare(strict_types=1);
 namespace Widmogrod\Primitive;
 
 use Widmogrod\Common;
-use Widmogrod\FantasyLand;
+use FunctionalPHP\FantasyLand;
 use Widmogrod\Functional as f;
 
 class ListtCons implements Listt, \IteratorAggregate
index 90ab725..c2a4c00 100644 (file)
@@ -5,7 +5,7 @@ declare(strict_types=1);
 namespace Widmogrod\Primitive;
 
 use Widmogrod\Common;
-use Widmogrod\FantasyLand;
+use FunctionalPHP\FantasyLand;
 
 class ListtNil implements Listt
 {
index 674831b..9b1402f 100644 (file)
@@ -5,7 +5,7 @@ declare(strict_types=1);
 namespace Widmogrod\Primitive;
 
 use Widmogrod\Common;
-use Widmogrod\FantasyLand;
+use FunctionalPHP\FantasyLand;
 
 class Num implements
     FantasyLand\Pointed,
index 820220c..7ddf62c 100644 (file)
@@ -4,7 +4,7 @@ declare(strict_types=1);
 
 namespace Widmogrod\Primitive;
 
-use Widmogrod\FantasyLand;
+use FunctionalPHP\FantasyLand;
 
 class Product extends Num implements
     FantasyLand\Monoid,
index 6b97611..c8e837b 100644 (file)
@@ -5,7 +5,7 @@ declare(strict_types=1);
 namespace Widmogrod\Primitive;
 
 use Widmogrod\Common;
-use Widmogrod\FantasyLand;
+use FunctionalPHP\FantasyLand;
 
 class Stringg implements
     FantasyLand\Pointed,
index 87a0adc..9192782 100644 (file)
@@ -4,7 +4,7 @@ declare(strict_types=1);
 
 namespace Widmogrod\Primitive;
 
-use Widmogrod\FantasyLand;
+use FunctionalPHP\FantasyLand;
 
 class Sum extends Num implements
     FantasyLand\Monoid,
index 2723268..03657cb 100644 (file)
@@ -4,7 +4,7 @@ declare(strict_types=1);
 
 namespace test\Functional;
 
-use Widmogrod\FantasyLand\Monad;
+use FunctionalPHP\FantasyLand\Monad;
 use Widmogrod\Monad\Identity;
 use Widmogrod\Monad\State;
 use const Widmogrod\Functional\identity;
index 8679de7..3cc8709 100644 (file)
@@ -4,7 +4,7 @@ declare(strict_types=1);
 
 namespace test\Functional;
 
-use Widmogrod\FantasyLand\Foldable;
+use FunctionalPHP\FantasyLand\Foldable;
 use function Widmogrod\Functional\fromIterable;
 use function Widmogrod\Functional\fromNil;
 use function Widmogrod\Functional\length;
index af9d100..12579b5 100644 (file)
@@ -4,12 +4,12 @@ declare(strict_types=1);
 
 namespace test\Monad;
 
-use Widmogrod\FantasyLand\Applicative;
-use Widmogrod\FantasyLand\Functor;
+use FunctionalPHP\FantasyLand\Applicative;
+use FunctionalPHP\FantasyLand\Functor;
 use Widmogrod\Functional as f;
-use Widmogrod\Helpful\ApplicativeLaws;
-use Widmogrod\Helpful\FunctorLaws;
-use Widmogrod\Helpful\MonadLaws;
+use FunctionalPHP\FantasyLand\Helpful\ApplicativeLaws;
+use FunctionalPHP\FantasyLand\Helpful\FunctorLaws;
+use FunctionalPHP\FantasyLand\Helpful\MonadLaws;
 use Widmogrod\Monad\Either;
 use Widmogrod\Monad\Either\Left;
 use Widmogrod\Monad\Either\Right;
index 3b313b8..00373c0 100644 (file)
@@ -4,11 +4,11 @@ declare(strict_types=1);
 
 namespace test\Monad;
 
-use Widmogrod\FantasyLand\Applicative;
-use Widmogrod\FantasyLand\Functor;
-use Widmogrod\Helpful\ApplicativeLaws;
-use Widmogrod\Helpful\FunctorLaws;
-use Widmogrod\Helpful\MonadLaws;
+use FunctionalPHP\FantasyLand\Applicative;
+use FunctionalPHP\FantasyLand\Functor;
+use FunctionalPHP\FantasyLand\Helpful\ApplicativeLaws;
+use FunctionalPHP\FantasyLand\Helpful\FunctorLaws;
+use FunctionalPHP\FantasyLand\Helpful\MonadLaws;
 use Widmogrod\Monad\Free\MonadFree;
 use Widmogrod\Monad\Free\Pure;
 use Widmogrod\Monad\Identity;
index eca0c0f..f39c642 100644 (file)
@@ -4,12 +4,12 @@ declare(strict_types=1);
 
 namespace test\Monad;
 
-use Widmogrod\FantasyLand\Applicative;
-use Widmogrod\FantasyLand\Functor;
+use FunctionalPHP\FantasyLand\Applicative;
+use FunctionalPHP\FantasyLand\Functor;
 use Widmogrod\Functional as f;
-use Widmogrod\Helpful\ApplicativeLaws;
-use Widmogrod\Helpful\FunctorLaws;
-use Widmogrod\Helpful\MonadLaws;
+use FunctionalPHP\FantasyLand\Helpful\ApplicativeLaws;
+use FunctionalPHP\FantasyLand\Helpful\FunctorLaws;
+use FunctionalPHP\FantasyLand\Helpful\MonadLaws;
 use Widmogrod\Monad\IO;
 
 class IOTest extends \PHPUnit\Framework\TestCase
index 8739424..85ac494 100644 (file)
@@ -4,12 +4,12 @@ declare(strict_types=1);
 
 namespace test\Monad;
 
-use Widmogrod\FantasyLand\Applicative;
-use Widmogrod\FantasyLand\Functor;
+use FunctionalPHP\FantasyLand\Applicative;
+use FunctionalPHP\FantasyLand\Functor;
 use Widmogrod\Functional as f;
-use Widmogrod\Helpful\ApplicativeLaws;
-use Widmogrod\Helpful\FunctorLaws;
-use Widmogrod\Helpful\MonadLaws;
+use FunctionalPHP\FantasyLand\Helpful\ApplicativeLaws;
+use FunctionalPHP\FantasyLand\Helpful\FunctorLaws;
+use FunctionalPHP\FantasyLand\Helpful\MonadLaws;
 use Widmogrod\Monad\Identity;
 
 class IdentityTest extends \PHPUnit\Framework\TestCase
index be8d685..b5deee8 100644 (file)
@@ -4,13 +4,13 @@ declare(strict_types=1);
 
 namespace test\Monad;
 
-use Widmogrod\FantasyLand\Applicative;
-use Widmogrod\FantasyLand\Functor;
+use FunctionalPHP\FantasyLand\Applicative;
+use FunctionalPHP\FantasyLand\Functor;
 use Widmogrod\Functional as f;
-use Widmogrod\Helpful\ApplicativeLaws;
-use Widmogrod\Helpful\FunctorLaws;
-use Widmogrod\Helpful\MonadLaws;
-use Widmogrod\Helpful\MonoidLaws;
+use FunctionalPHP\FantasyLand\Helpful\ApplicativeLaws;
+use FunctionalPHP\FantasyLand\Helpful\FunctorLaws;
+use FunctionalPHP\FantasyLand\Helpful\MonadLaws;
+use FunctionalPHP\FantasyLand\Helpful\MonoidLaws;
 use Widmogrod\Monad\Maybe;
 use Widmogrod\Monad\Maybe\Just;
 use Widmogrod\Monad\Maybe\Nothing;
index 311d0fa..5805dbb 100644 (file)
@@ -4,11 +4,11 @@ declare(strict_types=1);
 
 namespace test\Monad;
 
-use Widmogrod\FantasyLand\Applicative;
-use Widmogrod\FantasyLand\Functor;
-use Widmogrod\Helpful\ApplicativeLaws;
-use Widmogrod\Helpful\FunctorLaws;
-use Widmogrod\Helpful\MonadLaws;
+use FunctionalPHP\FantasyLand\Applicative;
+use FunctionalPHP\FantasyLand\Functor;
+use FunctionalPHP\FantasyLand\Helpful\ApplicativeLaws;
+use FunctionalPHP\FantasyLand\Helpful\FunctorLaws;
+use FunctionalPHP\FantasyLand\Helpful\MonadLaws;
 use Widmogrod\Monad\Reader;
 
 class ReaderTest extends \PHPUnit\Framework\TestCase
index 9c3d1c2..cde0110 100644 (file)
@@ -4,12 +4,12 @@ declare(strict_types=1);
 
 namespace test\Monad;
 
-use Widmogrod\FantasyLand\Applicative;
-use Widmogrod\FantasyLand\Functor;
+use FunctionalPHP\FantasyLand\Applicative;
+use FunctionalPHP\FantasyLand\Functor;
 use Widmogrod\Functional as f;
-use Widmogrod\Helpful\ApplicativeLaws;
-use Widmogrod\Helpful\FunctorLaws;
-use Widmogrod\Helpful\MonadLaws;
+use FunctionalPHP\FantasyLand\Helpful\ApplicativeLaws;
+use FunctionalPHP\FantasyLand\Helpful\FunctorLaws;
+use FunctionalPHP\FantasyLand\Helpful\MonadLaws;
 use Widmogrod\Monad\State;
 
 class StateTest extends \PHPUnit\Framework\TestCase
index 373f558..89f40d5 100644 (file)
@@ -4,11 +4,11 @@ declare(strict_types=1);
 
 namespace test\Monad;
 
-use Widmogrod\FantasyLand\Applicative;
-use Widmogrod\FantasyLand\Functor;
-use Widmogrod\Helpful\ApplicativeLaws;
-use Widmogrod\Helpful\FunctorLaws;
-use Widmogrod\Helpful\MonadLaws;
+use FunctionalPHP\FantasyLand\Applicative;
+use FunctionalPHP\FantasyLand\Functor;
+use FunctionalPHP\FantasyLand\Helpful\ApplicativeLaws;
+use FunctionalPHP\FantasyLand\Helpful\FunctorLaws;
+use FunctionalPHP\FantasyLand\Helpful\MonadLaws;
 use Widmogrod\Monad\Writer;
 
 class WriterTest extends \PHPUnit\Framework\TestCase
index ae08b36..b81730d 100644 (file)
@@ -5,14 +5,14 @@ declare(strict_types=1);
 namespace test\Monad;
 
 use Eris\TestTrait;
-use Widmogrod\FantasyLand\Applicative;
-use Widmogrod\FantasyLand\Functor;
-use Widmogrod\FantasyLand\Monoid;
+use FunctionalPHP\FantasyLand\Applicative;
+use FunctionalPHP\FantasyLand\Functor;
+use FunctionalPHP\FantasyLand\Monoid;
 use Widmogrod\Functional as f;
-use Widmogrod\Helpful\ApplicativeLaws;
-use Widmogrod\Helpful\FunctorLaws;
-use Widmogrod\Helpful\MonadLaws;
-use Widmogrod\Helpful\MonoidLaws;
+use FunctionalPHP\FantasyLand\Helpful\ApplicativeLaws;
+use FunctionalPHP\FantasyLand\Helpful\FunctorLaws;
+use FunctionalPHP\FantasyLand\Helpful\MonadLaws;
+use FunctionalPHP\FantasyLand\Helpful\MonoidLaws;
 use const Widmogrod\Functional\fromValue;
 use function Eris\Generator\choose;
 use function Eris\Generator\vector;
index 703b168..c7c478a 100644 (file)
@@ -6,7 +6,7 @@ namespace test\Primitive;
 
 use Eris\TestTrait;
 use Eris\Generator;
-use Widmogrod\Helpful\SetoidLaws;
+use FunctionalPHP\FantasyLand\Helpful\SetoidLaws;
 use Widmogrod\Primitive\Num;
 
 class NumTest extends \PHPUnit\Framework\TestCase
index ec71d71..7e0f8a0 100644 (file)
@@ -6,8 +6,8 @@ namespace test\Primitive;
 
 use Eris\Generator;
 use Eris\TestTrait;
-use Widmogrod\Helpful\MonoidLaws;
-use Widmogrod\Helpful\SetoidLaws;
+use FunctionalPHP\FantasyLand\Helpful\MonoidLaws;
+use FunctionalPHP\FantasyLand\Helpful\SetoidLaws;
 use Widmogrod\Primitive\Product;
 use Widmogrod\Primitive\Stringg;
 
index 1513fa5..41a854e 100644 (file)
@@ -6,8 +6,8 @@ namespace test\Widmogrod\Primitive;
 
 use Eris\Generator;
 use Eris\TestTrait;
-use Widmogrod\Helpful\MonoidLaws;
-use Widmogrod\Helpful\SetoidLaws;
+use FunctionalPHP\FantasyLand\Helpful\MonoidLaws;
+use FunctionalPHP\FantasyLand\Helpful\SetoidLaws;
 use Widmogrod\Primitive\Product;
 use Widmogrod\Primitive\Stringg;
 
index 32d05d8..3d29b2e 100644 (file)
@@ -6,8 +6,8 @@ namespace test\Primitive;
 
 use Eris\TestTrait;
 use Eris\Generator;
-use Widmogrod\Helpful\MonoidLaws;
-use Widmogrod\Helpful\SetoidLaws;
+use FunctionalPHP\FantasyLand\Helpful\MonoidLaws;
+use FunctionalPHP\FantasyLand\Helpful\SetoidLaws;
 use Widmogrod\Primitive\Product;
 use Widmogrod\Primitive\Sum;