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);
    }