Update interface of Semigroup
authorwidmogrod <widmogrod@gmail.com>
Sat, 23 Dec 2017 20:31:58 +0000 (21:31 +0100)
committerwidmogrod <widmogrod@gmail.com>
Sat, 23 Dec 2017 20:31:58 +0000 (21:31 +0100)
src/FantasyLand/Semigroup.php
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 d6593e5..26fab9c 100644 (file)
@@ -13,5 +13,5 @@ interface Semigroup
      *
      * @return Semigroup
      */
-    public function concat(self $value);
+    public function concat(self $value): self;
 }
index 1f4f915..35efaa6 100644 (file)
@@ -41,7 +41,7 @@ class Just implements Maybe
     /**
      * @inheritdoc
      */
-    public function concat(FantasyLand\Semigroup $value)
+    public function concat(FantasyLand\Semigroup $value): FantasyLand\Semigroup
     {
         if (!($value instanceof Maybe)) {
             throw new TypeMismatchError($value, Maybe::class);
index 69a336d..2b41dae 100644 (file)
@@ -45,7 +45,7 @@ class Nothing implements Maybe
     /**
      * @inheritdoc
      */
-    public function concat(FantasyLand\Semigroup $value)
+    public function concat(FantasyLand\Semigroup $value): FantasyLand\Semigroup
     {
         return $value;
     }
index eb0ac87..6c69cfd 100644 (file)
@@ -143,7 +143,7 @@ class ListtCons implements Listt, \IteratorAggregate
      *
      * @throws TypeMismatchError
      */
-    public function concat(FantasyLand\Semigroup $value)
+    public function concat(FantasyLand\Semigroup $value): FantasyLand\Semigroup
     {
         if ($value instanceof ListtNil) {
             return $this;
index c4e8c43..604fa54 100644 (file)
@@ -97,7 +97,7 @@ class ListtNil implements Listt
      *
      * @throws TypeMismatchError
      */
-    public function concat(FantasyLand\Semigroup $value)
+    public function concat(FantasyLand\Semigroup $value): FantasyLand\Semigroup
     {
         if ($value instanceof Listt) {
             return $value;
index 0f51504..83b9e2f 100644 (file)
@@ -29,7 +29,7 @@ class Product extends Num implements
     /**
      * @inheritdoc
      */
-    public function concat(FantasyLand\Semigroup $value)
+    public function concat(FantasyLand\Semigroup $value): FantasyLand\Semigroup
     {
         if ($value instanceof self) {
             return self::of($this->extract() * $value->extract());
index 76ec82d..2536415 100644 (file)
@@ -37,7 +37,7 @@ class Stringg implements
     /**
      * @inheritdoc
      */
-    public function concat(FantasyLand\Semigroup $value)
+    public function concat(FantasyLand\Semigroup $value): FantasyLand\Semigroup
     {
         if ($value instanceof self) {
             return self::of($this->value . $value->extract());
index 4e5c801..0cacbaf 100644 (file)
@@ -29,7 +29,7 @@ class Sum extends Num implements
     /**
      * @inheritdoc
      */
-    public function concat(FantasyLand\Semigroup $value)
+    public function concat(FantasyLand\Semigroup $value): FantasyLand\Semigroup
     {
         if ($value instanceof self) {
             return self::of($this->extract() + $value->extract());