JuliaFolds2 / ChunkSplitters.jl

Splitting collections into chunks
https://juliafolds2.github.io/ChunkSplitters.jl/
MIT License
50 stars 7 forks source link

Inconsistent types #15

Closed carstenbauer closed 1 year ago

carstenbauer commented 1 year ago
julia> x = rand(10);

julia> chunks(x, 5) |> eltype
UnitRange{Int64}

julia> chunks(x, 5) |> first
(1:2, 1)

(cc @Seelengrab)

lmiq commented 1 year ago

Fixed in: https://github.com/m3g/ChunkSplitters.jl/commit/25ea20517d75b00ee71784eb5e75674e6d731743

I'll release v2.0.3 with this fix if that's fine.

The eltype(::Chunk) was explicitly defined, and since version 2.0.2 we have a consistent return element type that is Tuple(StepRange{Int,Int}, Int}, so just fixing the definition of eltype(::Chunk) should be enough.

carstenbauer commented 1 year ago

Thanks!