Alias: select

@chainable
@category  Collections
@param     array            $xs
@param     callable|string  $f
@return    Generator
174710
public static function sortBy($xs, $f)
    {
        foreach (ArrayImpl::sortBy($xs, $f) as $k => $x) {
            yield $k => $x;
        }
    }
1188232
public function select($fields)
    {
        if (!is_array($fields)) {
            $fields = func_get_args();
        }

        $fields = $this->addTablePrefix($fields);
        $this->addStatement('selects', $fields);
        return $this;
    }
27425
public static function reduce(array $xs, \Closure $fn, $initial)
    {
        foreach ($xs as $key => $value) {
            $initial = $fn($initial, $key, $value);
        }
        return $initial;
    }
869932
function chain($funcs,$args=NULL) {
		$out=[];
		foreach (is_array($funcs)?$funcs:$this->split($funcs) as $func)
			$out[]=$this->call($func,$args);
		return $out;
	}
357808
public function from(string $table, string $alias = null, $field = null): Select
    {
        $this->from[] = [
          'table' => $table,
          'alias' => $alias
        ];

        if ($field !== null) {
            if (is_array($field)) {
                foreach ($field as $fld) {
                    $this->field(($alias ?? $table) . '.' . $fld);
                }
            } else {
                $this->field(($alias ?? $table) . '.' . $field);
            }
        }

        return $this;
    }
557100
public function map(callable $f): Tree
    {
        return $this->fold(function ($node, array $children) use ($f): Tree {
            return new Tree($f($node), $children);
        });
    }
954177
public function select($fields = [])
    {
        if (is_array($fields)) {
            foreach ($fields as $field) {
                $this->addSelect($field);
            }
        } elseif (is_string($fields)) {
            $this->addSelect($fields);
        }

        return $this;
    }
555335
public static function reduce(callable $f, $xs, $initial = null)
    {
        if (is_array($xs)) {
            $initial = $initial !== null ? $initial : array_shift($xs);
            return array_reduce($xs, $f, $initial);
        }
        if ($xs instanceof \Iterator) {
            $xs->rewind();
            if (!$xs->valid()) {
                return $initial;
            }
            $acc = $initial;
            if ($acc === null) {
                $acc = $xs->current();
                $xs->next();
            }
            for (; $xs->valid(); $xs->next()) {
                $acc = call_user_func($f, $acc, $xs->current());
            }
            return $acc;
        }
        throw new \InvalidArgumentException();
    }
178932
private function expandParentFqns(array $fqns) : Generator
    {
        foreach ($fqns as $fqn) {
            yield $fqn;
            $def = $this->index->getDefinition($fqn);
            if ($def !== null) {
                foreach ($def->getAncestorDefinitions($this->index) as $name => $def) {
                    yield $name;
                }
            }
        }
    }
102511
function groupOn(f, xs) {
    return groupBy((a, b) => f(a) === f(b), xs);
}
1210448
function select( $expr ) {

        $clone = clone $this;

        if ( $clone->select === null ) {

            $clone->select = func_get_args();

        } else {

            $clone->select = array_merge( $clone->select, func_get_args() );

        }

        return $clone;

    }
1080847
final public static function parMap($xs, $f, $n = 4, $timeout = null)
    {
        $parallel = new Internal\Parallel($f, $n, $timeout);
        $parallel->pushAll($xs);
        return $parallel;
    }
985904
public function select($select=null)
    {
        $select = LambdaUtils::toSelectCallable($select);

        $result = array();
        foreach($this as $key => $record)
        {
            $result[] = call_user_func($select, $record, $key);
        }
        return new ArrayList($result);
    }
272510
public function map(callable $f) : Result
    {
        $result = new self(array_map($f, $this->errors));
        $result->fatal = $this->fatal;

        return $result;
    }
83566
def filter(pred: Callable, xs: Iterable):
    
    generator = (x for x in xs if pred(x))

    return gather(*generator)
416592
public static function select(string $table = null, string $tableAlias = null): Query\Select
    {
        return static::getAdapter()->select($table, $tableAlias);
    }
1214927
public function select($column, string $alias = null): self
    {
        if (\is_string($column)) {
            if (\strpos($column, ',')) {
                $this->select = \array_merge($this->select, \array_filter(\explode(',', $column)));
            } else {
                $this->select[$column] = $alias;
            }
        } elseif (\is_array($column)) {
            foreach ($column as $col => $ali) {
                if (\is_numeric($col)) {
                    $this->select[$ali] = null;
                } else {
                    $this->select[$col] = $ali;
                }
            }
        }

        return $this;
    }