On Wed, 18 Oct 2023 09:22:39 GMT, Per Minborg <pminb...@openjdk.org> wrote:

>> Just curious, do we have any idea how extensively `UnaryOperator` is used as 
>> a parameter type in user code compared to plain `Function<T, T>`? If it's 
>> not preferred over `Function<T, T>`, this new method might not be very 
>> useful.
>
> Generally speaking, there are 1,594 usages of `Function` and 208 usages of 
> `UnaryFunction` in the JDK itself. More specifically, there are 8 usages of 
> `Function::andThen` and zero use of `UnaryOperator::andThen` in the JDK.

I've run some corpus analysis and this came up:


pminborg@pminborg-mac open % cat ~/Downloads/experiment-2.log | grep 
Function.andThen | wc -l
    6689
pminborg@pminborg-mac open % cat ~/Downloads/experiment-2.log | grep 
UnaryOperator.andThen | wc -l
     153

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/16213#discussion_r1363643007

Reply via email to