src/QCheck/Generator.php
private static function sequence($ms)
    {
        return FP::reduce(
            function (Generator $acc, Generator $elem) {
                return $acc->bindGen(function ($xs) use ($elem) {
                    return $elem->bindGen(function ($y) use ($xs) {
                        return self::pureGen(FP::push($xs, $y));
                    });
                });
            },
            $ms,
            self::pureGen([])
        );
    }
private static function sequence($ms)
    {
        return FP::reduce(
            function (Generator $acc, Generator $elem) {
                return $acc->bindGen(function ($xs) use ($elem) {
                    return $elem->bindGen(function ($y) use ($xs) {
                        return self::pureGen(FP::push($xs, $y));
                    });
                });
            },
            $ms,
            self::pureGen([])
        );
    }
private static function sequence ( $ ms ) { return FP :: reduce ( function ( Generator $ acc , Generator $ elem ) { return $ acc -> bindGen ( function ( $ xs ) use ( $ elem ) { return $ elem -> bindGen ( function ( $ y ) use ( $ xs ) { return self :: pureGen ( FP :: push ( $ xs , $ y ) ) ; } ) ; } ) ; } , $ ms , self :: pureGen ( [ ] ) ) ; }
turns a list of generators into a generator of a list

@param Generator[]|\Iterator $ms
@return Generator
turns a list of generators into a generator of a list