public static function curryArgs(callable $function, $args)
    {
        Arguments::define(Boa::func(), Boa::arr())->check($function, $args);

        // Counts required parameters.
        $required = function () use ($function) {
            return (new ReflectionFunction($function))
                ->getNumberOfRequiredParameters();
        };

        $isFulfilled = function (callable $function, $args) use ($required) {
            return count($args) >= $required($function);
        };

        if ($isFulfilled($function, $args)) {
            return static::apply($function, $args);
        }

        return function (...$funcArgs) use (
            $function,
            $args,
            $required,
            $isFulfilled
        ) {
            $newArgs = ArrayList::of($args)
                ->append(ArrayList::of($funcArgs))
                ->toArray();

            if ($isFulfilled($function, $newArgs)) {
                return static::apply($function, $newArgs);
            }

            return static::curryArgs($function, $newArgs);
        };
    }