Widmogrod\Primitive\Listt::concat PHP Method

concat() public method

public concat ( Widmogrod\FantasyLand\Semigroup $value )
$value Widmogrod\FantasyLand\Semigroup
    public function concat(FantasyLand\Semigroup $value)
    {
        if ($value instanceof self) {
            return self::of($value->reduce(function ($accumulator, $item) {
                $accumulator[] = $item;
                return $accumulator;
            }, $this->extract()));
        }
        throw new TypeMismatchError($value, self::class);
    }