FillArrays.jl
FillArrays.jl copied to clipboard
Specialize repeat(::Fill)
julia> repeat(Trues(2,3), 2,3)
4×9 Matrix{Bool}:
1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1
Seems wasteful to return a dense matrix here, when it can just return Trues(4,9).'
Same goes for all AbstractFill types, in all cases repeat(::AbstractFill) should return the a Fill type.
Related: https://github.com/JuliaArrays/FillArrays.jl/issues/23, it would make sense to have both of these added