diff --git a/base/reduce.jl b/base/reduce.jl index a1732a87f860f..5e048138990c7 100644 --- a/base/reduce.jl +++ b/base/reduce.jl @@ -465,8 +465,8 @@ function mapreduce_impl(f, op::Union{typeof(max), typeof(min)}, v end -maximum(f::Callable, a) = mapreduce(f, max, a) -minimum(f::Callable, a) = mapreduce(f, min, a) +maximum(f, a) = mapreduce(f, max, a) +minimum(f, a) = mapreduce(f, min, a) """ maximum(itr) diff --git a/base/reducedim.jl b/base/reducedim.jl index b9aa36070f504..ccda3d429bd33 100644 --- a/base/reducedim.jl +++ b/base/reducedim.jl @@ -643,7 +643,7 @@ for (fname, _fname, op) in [(:sum, :_sum, :add_sum), (:prod, :_prod, @eval begin # User-facing methods with keyword arguments @inline ($fname)(a::AbstractArray; dims=:) = ($_fname)(a, dims) - @inline ($fname)(f::Callable, a::AbstractArray; dims=:) = ($_fname)(f, a, dims) + @inline ($fname)(f, a::AbstractArray; dims=:) = ($_fname)(f, a, dims) # Underlying implementations using dispatch ($_fname)(a, ::Colon) = ($_fname)(identity, a, :) diff --git a/base/set.jl b/base/set.jl index ab64837aa9ce1..1a25aa1c2a859 100644 --- a/base/set.jl +++ b/base/set.jl @@ -165,7 +165,7 @@ julia> unique(x -> x^2, [1, -1, 3, -3, 4]) 4 ``` """ -function unique(f::Callable, C) +function unique(f, C) out = Vector{eltype(C)}() seen = Set() for x in C diff --git a/stdlib/Statistics/src/Statistics.jl b/stdlib/Statistics/src/Statistics.jl index 74b1fb7b572e5..c1c0c37640fd1 100644 --- a/stdlib/Statistics/src/Statistics.jl +++ b/stdlib/Statistics/src/Statistics.jl @@ -54,7 +54,7 @@ julia> mean([√1, √2, √3]) 1.3820881233139908 ``` """ -function mean(f::Base.Callable, itr) +function mean(f, itr) y = iterate(itr) if y === nothing return Base.mapreduce_empty_iter(f, Base.add_sum, itr, @@ -73,7 +73,7 @@ function mean(f::Base.Callable, itr) end return total/count end -mean(f::Base.Callable, A::AbstractArray) = sum(f, A) / length(A) +mean(f, A::AbstractArray) = sum(f, A) / length(A) """ mean!(r, v)