Remove getEmpty() methods
authorwidmogrod <widmogrod@gmail.com>
Sat, 23 Dec 2017 21:24:57 +0000 (22:24 +0100)
committerwidmogrod <widmogrod@gmail.com>
Sat, 23 Dec 2017 21:24:57 +0000 (22:24 +0100)
src/Monad/Maybe/Just.php
src/Monad/Maybe/Nothing.php
src/Primitive/ListtCons.php
src/Primitive/ListtNil.php
src/Primitive/Product.php
src/Primitive/Stringg.php
src/Primitive/Sum.php

index 13f1c3e..5e60a67 100644 (file)
@@ -69,14 +69,6 @@ class Just implements Maybe
     /**
      * @inheritdoc
      */
-    public function getEmpty()
-    {
-        return self::mempty();
-    }
-
-    /**
-     * @inheritdoc
-     */
     public function orElse(callable $fn)
     {
         return $this;
index 73a37bf..af00a27 100644 (file)
@@ -61,14 +61,6 @@ class Nothing implements Maybe
     /**
      * @inheritdoc
      */
-    public function getEmpty()
-    {
-        return self::mempty();
-    }
-
-    /**
-     * @inheritdoc
-     */
     public function orElse(callable $fn)
     {
         return $fn();
index 46ff79d..3cdf8e2 100644 (file)
@@ -111,10 +111,10 @@ class ListtCons implements Listt, \IteratorAggregate
      * (<$>) :: Functor f => (a -> b) -> f a -> f b
      * (<*>) :: f (a -> b) -> f a -> f b
      */
-    public function traverse(callable $f)
+    public function traverse(callable $fn)
     {
-        return f\foldr(function ($x, $ys) use ($f) {
-            $functor = $f($x);
+        return f\foldr(function ($x, $ys) use ($fn) {
+            $functor = $fn($x);
 
             return $functor
                 ->map(f\prepend)
@@ -132,14 +132,6 @@ class ListtCons implements Listt, \IteratorAggregate
 
     /**
      * @inheritdoc
-     */
-    public function getEmpty()
-    {
-        return self::mempty();
-    }
-
-    /**
-     * @inheritdoc
      *
      * @throws TypeMismatchError
      */
index f7ebcf7..2420afe 100644 (file)
@@ -71,7 +71,7 @@ class ListtNil implements Listt
      * (<$>) :: Functor f => (a -> b) -> f a -> f b
      * (<*>) :: f (a -> b) -> f a -> f b
      */
-    public function traverse(callable $f)
+    public function traverse(callable $fn)
     {
         throw new EmptyListError(__FUNCTION__);
     }
@@ -86,14 +86,6 @@ class ListtNil implements Listt
 
     /**
      * @inheritdoc
-     */
-    public function getEmpty()
-    {
-        return self::mempty();
-    }
-
-    /**
-     * @inheritdoc
      *
      * @throws TypeMismatchError
      */
index 83b9e2f..820220c 100644 (file)
@@ -21,14 +21,6 @@ class Product extends Num implements
     /**
      * @inheritdoc
      */
-    public function getEmpty()
-    {
-        return self::mempty();
-    }
-
-    /**
-     * @inheritdoc
-     */
     public function concat(FantasyLand\Semigroup $value): FantasyLand\Semigroup
     {
         if ($value instanceof self) {
index a95495a..d279a96 100644 (file)
@@ -29,14 +29,6 @@ class Stringg implements
     /**
      * @inheritdoc
      */
-    public function getEmpty()
-    {
-        return self::mempty();
-    }
-
-    /**
-     * @inheritdoc
-     */
     public function concat(FantasyLand\Semigroup $value): FantasyLand\Semigroup
     {
         if ($value instanceof self) {
index 0cacbaf..87a0adc 100644 (file)
@@ -21,14 +21,6 @@ class Sum extends Num implements
     /**
      * @inheritdoc
      */
-    public function getEmpty()
-    {
-        return self::mempty();
-    }
-
-    /**
-     * @inheritdoc
-     */
     public function concat(FantasyLand\Semigroup $value): FantasyLand\Semigroup
     {
         if ($value instanceof self) {