@param callable $function

@return NodeList
519520
public function map(callable $function): NodeList {
        $nodes = $this->newNodeList();

        foreach ($this->nodes as $node) {
            $result = $function($node);

            if (!is_null($result) && $result !== false) {
                $nodes[] = $result;
            }
        }

        return $nodes;
    }
541921
public function filter(callable $fn)
    {
        $this->items = array_values(array_filter($this->items, $fn));

        return $this;
    }
1130678
public function map(callable $f) : NestableResult
    {
        return new self(
            $this->outer->map($f),
            array_map($f, $this->inner)
        );
    }
979224
public static function each(callable $function, $input)
    {
        if ($input instanceof FoldableInterface) {
            $input->foldl(function ($acc, $x) use ($function) {
                $function($x);
            }, null);

            return;
        } elseif ($input instanceof LeftFoldableInterface) {
            $input->foldl(function ($x) use ($function) {
                $function($x);
            }, null);

            return;
        }

        static::map($function, $input);
    }
650403
public function setConvertValueFunction(callable $function)
    {
        $validator = $this->getCallableValidatorConvertValue();
        $validator->setCallableFunction($function);

        if ($validator->isValid() === false) {
            throw $validator->getException();
        }

        $this->convertValueFunction = $function;

        return $this;
    }
456902
public static function create(callable $function, ...$params)
    {
        $tid = self::tid();
        $top = $tid == self::id();
        static::go($function, $params, $tid, $top);
    }
1297063
public function filter(callable $func) : self
    {
        $list = $this->list;
        $acc = [];

        foreach ($list as $index => $val) {
            if ($func($val)) {
                $acc[] = $val;
            }
        }

        return new static(\SplFixedArray::fromArray($acc));
    }
173420
private function sortableCallSpecial($function, $arguments)
    {
        $params = array_merge(
            array_slice($arguments, 0, 1),
            [$this->sortableConcreteData()],
            array_values(array_slice($arguments, 1))
        );
        return call_user_func_array($function, $params);
    }
1154797
public function map(callable $f) {
        return !$this->isEmpty() ? Option::just($f($this->get())) : Option::none();
    }
1156270
public function groupBy(callable $func)
    {
        $result = [];
        foreach ($this->each() as $k => $v) {
            $this->_groupBy($result, $k, $v, $func);
        }
        return $result;
    }
307036
public static function mapRecursive($iterable, callable $callable): array
    {
        Assert::isIterable($iterable);

        // If internal method with one arg, like strtolower, limit to first arg so warning isn't triggered.
        $ref = new \ReflectionFunction($callable);
        if ($ref->isInternal() && $ref->getNumberOfParameters() === 1) {
            $callable = function ($arg) use ($callable) {
                return $callable($arg);
            };
        }

        return static::doMapRecursive($iterable, $callable);
    }
71180
public function add($input): NodeList {
        $nodes = $this->inputAsNodeList($input);

        $results = $this->collection()->merge(
            $nodes
        );

        return $results;
    }
738411
protected function parseFunction(FunctionLike $node, FunctionModelInterface $function): void
    {
        foreach ($node->getParams() as $param) {
            $this->parameterNodeParser->invoke($param, $function);
        }

        $return = new ReturnModel();
        $return->setParentNode($function);
        if ($node->getReturnType() !== null) {
            $this->typeNodeParser->invoke($node->getReturnType(), $return);
        }
        $function->setReturn($return);
    }
952284
public function walkNodes(callable $fn)
    {
        foreach ($this->_children as $node) {
            $node->walkNodes($fn);
        }
        $fn($this);
    }
46524
public function reduceRight(callable $function)
    {
        if ($this->isEmpty()) {
            return null;
        }

        list($head, $tail) = $this->reverse()->headAndTail();

        return array_reduce($tail->all(), $function, $head);
    }
1364914
public function bind(callable $function) : Monadic
    {
        list($result, $output) = $function($this->result)->run();

        return self::of($result, flatten(extend($this->output, $output)));
    }
626167
public function map(callable $fn) : self
    {
        $validate = $fn instanceof Closure;

        $b = [];

        foreach ($this->a as $row) {
            $b[] = array_map($fn, $row);
        }

        return new self($b, $validate);
    }