types/Sum.php
public function concat(Semigroup $that): Semigroup {
        if (!$that instanceof self) {
            throw new \LogicException('Semigroup cannot concatenate two distinct types.');
        }
        return new Sum($this->value + $that->value);
    }
public function concat(Semigroup $that): Semigroup {
        if (!$that instanceof self) {
            throw new \LogicException('Semigroup cannot concatenate two distinct types.');
        }
        return new Sum($this->value + $that->value);
    }
public function concat ( Semigroup $ that ) : Semigroup { if ( ! $ that instanceof self ) { throw new \ LogicException ( 'Semigroup cannot concatenate two distinct types.' ) ; } return new Sum ( $ this -> value + $ that -> value ) ; }
Concatenate two semigroups.

@param  Semigroup $that
@return Semigroup
Concatenate two semigroups .